summaryrefslogtreecommitdiffstats
path: root/Lib/_pyio.py
diff options
context:
space:
mode:
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 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.