Fix broken socket.makefile emulation in test_urllib
This commit is contained in:
parent
9a1d6e3022
commit
598c3a8ad1
|
@ -146,7 +146,8 @@ class urlopen_HttpTests(unittest.TestCase):
|
||||||
def fakehttp(self, fakedata):
|
def fakehttp(self, fakedata):
|
||||||
class FakeSocket(io.BytesIO):
|
class FakeSocket(io.BytesIO):
|
||||||
def sendall(self, str): pass
|
def sendall(self, str): pass
|
||||||
def makefile(self, mode, name): return self
|
def makefile(self, *args, **kwds):
|
||||||
|
return self
|
||||||
def read(self, amt=None):
|
def read(self, amt=None):
|
||||||
if self.closed: return b""
|
if self.closed: return b""
|
||||||
return io.BytesIO.read(self, amt)
|
return io.BytesIO.read(self, amt)
|
||||||
|
|
Loading…
Reference in New Issue