summaryrefslogtreecommitdiffstats
path: root/Lib/urllib2.py
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2004-06-07 03:49:50 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2004-06-07 03:49:50 (GMT)
commit1cdd3632a0eeffd1efc71c6d650b5e340536cb63 (patch)
treedfd42bc8a129521a0240d960b4a9b0d3cfa2eba4 /Lib/urllib2.py
parent492faa5505add29b790022e7afba61415a93c9ad (diff)
downloadcpython-1cdd3632a0eeffd1efc71c6d650b5e340536cb63.zip
cpython-1cdd3632a0eeffd1efc71c6d650b5e340536cb63.tar.gz
cpython-1cdd3632a0eeffd1efc71c6d650b5e340536cb63.tar.bz2
Cleanup: the in operator already returns a bool, no need to bool() it again
Cleanup: use condition to be consistent with code above CookieJar is in cookielib
Diffstat (limited to 'Lib/urllib2.py')
-rw-r--r--Lib/urllib2.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/urllib2.py b/Lib/urllib2.py
index 448e948..301b5de 100644
--- a/Lib/urllib2.py
+++ b/Lib/urllib2.py
@@ -263,8 +263,8 @@ class Request:
self.unredirected_hdrs[key.capitalize()] = val
def has_header(self, header_name):
- return bool(header_name in self.headers or
- header_name in self.unredirected_hdrs)
+ return (header_name in self.headers or
+ header_name in self.unredirected_hdrs)
def get_header(self, header_name, default=None):
return self.headers.get(
@@ -295,7 +295,7 @@ class OpenerDirector:
condition = meth[i+1:]
if condition.startswith("error"):
- j = meth[i+1:].find("_") + i + 1
+ j = condition.find("_") + i + 1
kind = meth[j+1:]
try:
kind = int(kind)
@@ -1026,7 +1026,7 @@ if hasattr(httplib, 'HTTPS'):
class HTTPCookieProcessor(BaseHandler):
def __init__(self, cookiejar=None):
if cookiejar is None:
- cookiejar = CookieJar()
+ cookiejar = cookielib.CookieJar()
self.cookiejar = cookiejar
def http_request(self, request):