mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
(Merge 3.2) Issue #12175: RawIOBase.readall() now returns None if read()
returns None.
This commit is contained in:
commit
d2780aedce
4 changed files with 28 additions and 11 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue