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

returns None.
This commit is contained in:
Victor Stinner 2011-05-25 22:49:15 +02:00
commit 988512cfd7
4 changed files with 23 additions and 6 deletions

View file

@ -558,7 +558,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 bytearray b.