Fix a few places that broke due to a recent change to io.py.

This commit is contained in:
Guido van Rossum 2007-08-27 18:10:06 +00:00
parent 5abbf750a2
commit 700bd92677
2 changed files with 3 additions and 1 deletions

View File

@ -673,7 +673,7 @@ class HandlerTests(unittest.TestCase):
self.assertEqual(req.type, "ftp") self.assertEqual(req.type, "ftp")
def test_http(self): def test_http(self):
class MockHTTPResponse: class MockHTTPResponse(io.IOBase):
def __init__(self, fp, msg, status, reason): def __init__(self, fp, msg, status, reason):
self.fp = fp self.fp = fp
self.msg = msg self.msg = msg

View File

@ -1079,6 +1079,8 @@ class AbstractHTTPHandler(BaseHandler):
# Add some fake methods to the reader to satisfy BufferedReader. # Add some fake methods to the reader to satisfy BufferedReader.
r.readable = lambda: True r.readable = lambda: True
r.writable = r.seekable = lambda: False r.writable = r.seekable = lambda: False
r._checkReadable = lambda: True
r._checkWritable = lambda: False
fp = io.BufferedReader(r) fp = io.BufferedReader(r)
resp = addinfourl(fp, r.msg, req.get_full_url()) resp = addinfourl(fp, r.msg, req.get_full_url())