summaryrefslogtreecommitdiffstats
path: root/Lib/_pyio.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-05-25 20:47:16 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-05-25 20:47:16 (GMT)
commita80987f20d0c73532127e1c3f69f7983c5c443d2 (patch)
tree7747598f8d947aada125c326de1940792ae69d39 /Lib/_pyio.py
parentb79f28ccbd0cde0580a8d7198ac62e97e7cfb4c4 (diff)
downloadcpython-a80987f20d0c73532127e1c3f69f7983c5c443d2.zip
cpython-a80987f20d0c73532127e1c3f69f7983c5c443d2.tar.gz
cpython-a80987f20d0c73532127e1c3f69f7983c5c443d2.tar.bz2
Issue #12175: RawIOBase.readall() now returns None if read() returns None.
Diffstat (limited to 'Lib/_pyio.py')
-rw-r--r--Lib/_pyio.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/_pyio.py b/Lib/_pyio.py
index fa00eb4..5474a4e 100644
--- a/Lib/_pyio.py
+++ b/Lib/_pyio.py
@@ -556,7 +556,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.