Slight style cleanup.
diff --git a/Lib/urllib.py b/Lib/urllib.py
index 6cb95f3..be91a2d 100644
--- a/Lib/urllib.py
+++ b/Lib/urllib.py
@@ -765,7 +765,7 @@
else:
return self.open(newurl, data)
- def get_user_passwd(self, host, realm, clear_cache = 0):
+ def get_user_passwd(self, host, realm, clear_cache=0):
key = realm + '@' + host.lower()
if key in self.auth_cache:
if clear_cache:
@@ -1157,7 +1157,8 @@
return attr, None
_hexdig = '0123456789ABCDEFabcdef'
-_hextochr = dict((a+b, chr(int(a+b,16))) for a in _hexdig for b in _hexdig)
+_hextochr = dict((a + b, chr(int(a + b, 16)))
+ for a in _hexdig for b in _hexdig)
def unquote(s):
"""unquote('abc%20def') -> 'abc def'."""
@@ -1182,7 +1183,7 @@
'0123456789' '_.-')
_safemaps = {}
-def quote(s, safe = '/'):
+def quote(s, safe='/'):
"""quote('abc def') -> 'abc%20def'
Each part of a URL, e.g. the path info, the query, etc., has a
@@ -1216,14 +1217,14 @@
res = map(safe_map.__getitem__, s)
return ''.join(res)
-def quote_plus(s, safe = ''):
+def quote_plus(s, safe=''):
"""Quote the query fragment of a URL; replacing ' ' with '+'"""
if ' ' in s:
s = quote(s, safe + ' ')
return s.replace(' ', '+')
return quote(s, safe)
-def urlencode(query,doseq=0):
+def urlencode(query, doseq=0):
"""Encode a sequence of two-element tuples or dictionary into a URL query string.
If any values in the query arg are sequences and doseq is true, each
@@ -1380,7 +1381,6 @@
return False
-
def getproxies_macosx_sysconf():
"""Return a dictionary of scheme -> proxy server URL mappings.
@@ -1389,8 +1389,6 @@
"""
return _get_proxies()
-
-
def proxy_bypass(host):
if getproxies_environment():
return proxy_bypass_environment(host)