Fix a few places that broke due to a recent change to io.py.
This commit is contained in:
parent
5abbf750a2
commit
700bd92677
|
@ -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):
|
||||||
# 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())
|
||||||
|
|
Loading…
Reference in New Issue