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:
Aram Dulyan
2011-03-09 22:31:13 +11:00
parent a67cc5c5a9
commit 89192c64f0
+2 -2
View File
@@ -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: