mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
An empty cookiejar evaluates to False, so it needs to be compared to None for the cookie functionality to work.
This commit is contained in:
+2
-2
@@ -111,7 +111,7 @@ class Request(object):
|
||||
|
||||
_handlers = []
|
||||
|
||||
if self.cookiejar:
|
||||
if self.cookiejar is not None:
|
||||
_handlers.append(urllib2.HTTPCookieProcessor(self.cookiejar))
|
||||
|
||||
if self.auth:
|
||||
@@ -189,7 +189,7 @@ class Request(object):
|
||||
opener = self._get_opener()
|
||||
resp = opener(req)
|
||||
|
||||
if self.cookiejar:
|
||||
if self.cookiejar is not None:
|
||||
self.cookiejar.extract_cookies(resp, req)
|
||||
|
||||
except urllib2.HTTPError, why:
|
||||
|
||||
Reference in New Issue
Block a user