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

This commit is contained in:
Victor Stinner 2011-05-25 22:52:37 +02:00
parent 5100a405dc
commit daf17e9bc8
4 changed files with 20 additions and 3 deletions

View file

@ -560,7 +560,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.