]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix a few places that broke due to a recent change to io.py.
authorGuido van Rossum <guido@python.org>
Mon, 27 Aug 2007 18:10:06 +0000 (18:10 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 27 Aug 2007 18:10:06 +0000 (18:10 +0000)
Lib/test/test_urllib2.py
Lib/urllib2.py

index dff840ecc037f5464fb1bbab9e39df461a53aa9f..22979f6947623feffc999e799714988f2e8e5b01 100644 (file)
@@ -673,7 +673,7 @@ class HandlerTests(unittest.TestCase):
                 self.assertEqual(req.type, "ftp")
 
     def test_http(self):
-        class MockHTTPResponse:
+        class MockHTTPResponse(io.IOBase):
             def __init__(self, fp, msg, status, reason):
                 self.fp = fp
                 self.msg = msg
index 658bc3dc7aabe4f58620a8228552af44936511db..1defbe93b5d813d2e4286e498dc9258ed0450e6f 100644 (file)
@@ -1079,6 +1079,8 @@ class AbstractHTTPHandler(BaseHandler):
         # Add some fake methods to the reader to satisfy BufferedReader.
         r.readable = lambda: True
         r.writable = r.seekable = lambda: False
+        r._checkReadable = lambda: True
+        r._checkWritable = lambda: False
         fp = io.BufferedReader(r)
 
         resp = addinfourl(fp, r.msg, req.get_full_url())