diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-05-25 20:51:16 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-05-25 20:51:16 (GMT) |
commit | d2780aedce824867ed14bd9a2a5ef050ae0c8d30 (patch) | |
tree | e1f7313f05fc0220b3a0911c2ba3f11429f049c8 /Lib/_pyio.py | |
parent | af62c7d3deb6e6db5a0ef1190b8dd889be013a41 (diff) | |
parent | 988512cfd7c896dd8b900d0f00cba05c4c807dc3 (diff) | |
download | cpython-d2780aedce824867ed14bd9a2a5ef050ae0c8d30.zip cpython-d2780aedce824867ed14bd9a2a5ef050ae0c8d30.tar.gz cpython-d2780aedce824867ed14bd9a2a5ef050ae0c8d30.tar.bz2 |
(Merge 3.2) Issue #12175: RawIOBase.readall() now returns None if read()
returns None.
Diffstat (limited to 'Lib/_pyio.py')
-rw-r--r-- | Lib/_pyio.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/_pyio.py b/Lib/_pyio.py index a3b89e7..74047bf 100644 --- a/Lib/_pyio.py +++ b/Lib/_pyio.py @@ -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. |