diff options
author | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2008-04-22 21:17:18 (GMT) |
---|---|---|
committer | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2008-04-22 21:17:18 (GMT) |
commit | 8d904c39819eff6950bb4e712b28c434f0131af4 (patch) | |
tree | cefa39b989e55dc7652aaa9e7ee3dc539282691a /Lib/urllib2.py | |
parent | f305bd3ea25f58171b00afcef386cdbf16336890 (diff) | |
download | cpython-8d904c39819eff6950bb4e712b28c434f0131af4.zip cpython-8d904c39819eff6950bb4e712b28c434f0131af4.tar.gz cpython-8d904c39819eff6950bb4e712b28c434f0131af4.tar.bz2 |
Issue #2670: urllib2.build_opener() failed when two handlers
derive the same default base class.
Backport of r62463.
Diffstat (limited to 'Lib/urllib2.py')
-rw-r--r-- | Lib/urllib2.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/urllib2.py b/Lib/urllib2.py index 3578e7a..50d7aaf 100644 --- a/Lib/urllib2.py +++ b/Lib/urllib2.py @@ -447,14 +447,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) |