diff options
Diffstat (limited to 'Lib/_pyio.py')
-rw-r--r-- | Lib/_pyio.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/_pyio.py b/Lib/_pyio.py index ffbfda1..4485233 100644 --- a/Lib/_pyio.py +++ b/Lib/_pyio.py @@ -542,6 +542,8 @@ class RawIOBase(IOBase): return self.readall() b = bytearray(n.__index__()) n = self.readinto(b) + if n is None: + return None del b[n:] return bytes(b) @@ -559,7 +561,7 @@ class RawIOBase(IOBase): """Read up to len(b) bytes into b. Returns number of bytes read (0 for EOF), or None if the object - is set not to block as has no data to read. + is set not to block and has no data to read. """ self._unsupported("readinto") |