Commit 700bd926 authored by Guido van Rossum's avatar Guido van Rossum

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

parent 5abbf750
...@@ -673,7 +673,7 @@ class HandlerTests(unittest.TestCase): ...@@ -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
......
...@@ -1079,6 +1079,8 @@ class AbstractHTTPHandler(BaseHandler): ...@@ -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())
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment