Fix broken socket.makefile emulation in test_urllib

This commit is contained in:
Nick Coghlan 2009-02-08 04:01:00 +00:00
parent 9a1d6e3022
commit 598c3a8ad1
1 changed files with 2 additions and 1 deletions

View File

@ -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)