diff options
author | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2008-04-22 21:14:41 (GMT) |
---|---|---|
committer | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2008-04-22 21:14:41 (GMT) |
commit | 9686585a82defca236da0e29f44137c491d9e980 (patch) | |
tree | d7ea91d89c5b0a4269a287aed06b30c9a712fa77 /Lib/test/test_urllib2.py | |
parent | d59fefb23adc75fbdec618e24e93848ae406e3d8 (diff) | |
download | cpython-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/test/test_urllib2.py')
-rw-r--r-- | Lib/test/test_urllib2.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_urllib2.py b/Lib/test/test_urllib2.py index 58cb2a8..8d17e05 100644 --- a/Lib/test/test_urllib2.py +++ b/Lib/test/test_urllib2.py @@ -1063,6 +1063,12 @@ class MiscTests(unittest.TestCase): o = build_opener(urllib2.HTTPHandler()) self.opener_has_handler(o, urllib2.HTTPHandler) + # Issue2670: multiple handlers sharing the same base class + class MyOtherHTTPHandler(urllib2.HTTPHandler): pass + o = build_opener(MyHTTPHandler, MyOtherHTTPHandler) + self.opener_has_handler(o, MyHTTPHandler) + self.opener_has_handler(o, MyOtherHTTPHandler) + def opener_has_handler(self, opener, handler_class): for h in opener.handlers: if h.__class__ == handler_class: |