Issue #12175: RawIOBase.readall() now returns None if read() returns None.

This commit is contained in:
Victor Stinner 2011-05-25 22:47:16 +02:00
parent b79f28ccbd
commit a80987f20d
4 changed files with 20 additions and 3 deletions

View file

@ -556,7 +556,11 @@ class RawIOBase(IOBase):
if not data:
break
res += data
return bytes(res)
if res:
return bytes(res)
else:
# b'' or None
return data
def readinto(self, b):
"""Read up to len(b) bytes into b.