double try statement
authordaftshady <daftonshady@gmail.com>
Tue, 5 Nov 2013 16:10:27 +0000 (01:10 +0900)
committerdaftshady <daftonshady@gmail.com>
Tue, 26 Nov 2013 06:28:59 +0000 (15:28 +0900)
requests/cookies.py

index 8ff8b02..0fc343d 100644 (file)
@@ -437,9 +437,9 @@ def merge_cookies(cookiejar, cookies):
             cookies, cookiejar=cookiejar, overwrite=False)
     elif isinstance(cookies, cookielib.CookieJar):
         try:
-            if hasattr(cookiejar, 'update'):
+            try:
                 cookiejar.update(cookies)
-            else:
+            except AttributeError:
                 raise CookieJarError
         except CookieJarError:
             for cookie_in_jar in cookies: