diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-06-17 12:02:18 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-06-17 12:02:18 (GMT) |
commit | f073dc286c0d489dfb71046df0358a49e8a26086 (patch) | |
tree | 115f2e083978b9c6e97f15216e73fee8baeddf75 /Lib/test/test_urllib2.py | |
parent | 723993983a8227d7f068b072657caa2b75d4413c (diff) | |
parent | a4c45d73cf6eeb8ede6ee701c0372d7e45dc24f2 (diff) | |
download | cpython-f073dc286c0d489dfb71046df0358a49e8a26086.zip cpython-f073dc286c0d489dfb71046df0358a49e8a26086.tar.gz cpython-f073dc286c0d489dfb71046df0358a49e8a26086.tar.bz2 |
(Merge 3.2) Issue #12133: fix a ResourceWarning in urllib.request
AbstractHTTPHandler.do_open() of urllib.request closes the HTTP connection if
its getresponse() method fails with a socket error. Patch written by Ezio
Melotti.
Diffstat (limited to 'Lib/test/test_urllib2.py')
-rw-r--r-- | Lib/test/test_urllib2.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_urllib2.py b/Lib/test/test_urllib2.py index 8cd5ca0..d19e116 100644 --- a/Lib/test/test_urllib2.py +++ b/Lib/test/test_urllib2.py @@ -318,6 +318,9 @@ class MockHTTPClass: def getresponse(self): return MockHTTPResponse(MockFile(), {}, 200, "OK") + def close(self): + pass + class MockHandler: # useful for testing handler machinery # see add_ordered_mock_handlers() docstring |