summaryrefslogtreecommitdiffstats
path: root/Lib/urllib2.py
diff options
context:
space:
mode:
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-04-22 21:14:41 (GMT)
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-04-22 21:14:41 (GMT)
commit9686585a82defca236da0e29f44137c491d9e980 (patch)
treed7ea91d89c5b0a4269a287aed06b30c9a712fa77 /Lib/urllib2.py
parentd59fefb23adc75fbdec618e24e93848ae406e3d8 (diff)
downloadcpython-9686585a82defca236da0e29f44137c491d9e980.zip
cpython-9686585a82defca236da0e29f44137c491d9e980.tar.gz
cpython-9686585a82defca236da0e29f44137c491d9e980.tar.bz2
Issue #2670: urllib2.build_opener() failed when two handlers
derive the same default base class. Will backport.
Diffstat (limited to 'Lib/urllib2.py')
-rw-r--r--Lib/urllib2.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/urllib2.py b/Lib/urllib2.py
index a20e552..817c5a7 100644
--- a/Lib/urllib2.py
+++ b/Lib/urllib2.py
@@ -446,14 +446,14 @@ def build_opener(*handlers):
FTPHandler, FileHandler, HTTPErrorProcessor]
if hasattr(httplib, 'HTTPS'):
default_classes.append(HTTPSHandler)
- skip = []
+ skip = set()
for klass in default_classes:
for check in handlers:
if isclass(check):
if issubclass(check, klass):
- skip.append(klass)
+ skip.add(klass)
elif isinstance(check, klass):
- skip.append(klass)
+ skip.add(klass)
for klass in skip:
default_classes.remove(klass)