summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/urllib.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/Lib/urllib.py b/Lib/urllib.py
index a818adf..02edb3b 100644
--- a/Lib/urllib.py
+++ b/Lib/urllib.py
@@ -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)]