Patch #1752270, #1750931: complain if urllib2 add_handler called
without handler.
diff --git a/Lib/test/test_urllib2.py b/Lib/test/test_urllib2.py
index c9dcf5e..90e1771 100644
--- a/Lib/test/test_urllib2.py
+++ b/Lib/test/test_urllib2.py
@@ -381,6 +381,12 @@
class OpenerDirectorTests(unittest.TestCase):
+ def test_add_non_handler(self):
+ class NonHandler(object):
+ pass
+ self.assertRaises(TypeError,
+ OpenerDirector().add_handler, NonHandler())
+
def test_badly_named_methods(self):
# test work-around for three methods that accidentally follow the
# naming conventions for handler methods