Commit 44b817aa authored by Guido van Rossum's avatar Guido van Rossum

Assert that the proxies object passed in to the URLopener constructor

is indeed a dictionary (or a mapping).
parent b8dfc2dd
......@@ -87,6 +87,7 @@ class URLopener:
def __init__(self, proxies=None):
if proxies is None:
proxies = getproxies()
assert hasattr(proxies, 'has_key'), "proxies must be a mapping"
self.proxies = proxies
server_version = "Python-urllib/%s" % __version__
self.addheaders = [('User-agent', server_version)]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment