summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorAlexandre Vassalotti <alexandre@peadrop.com>2008-05-07 00:09:04 (GMT)
committerAlexandre Vassalotti <alexandre@peadrop.com>2008-05-07 00:09:04 (GMT)
commit2e0419dcd69cab245d30b92a7f442fd4617ca8f8 (patch)
tree3235d58d48fd8f5330043242eeb1598863eb09ef /Lib
parent8e99760c90c33fbfa1fbf8370df4b8503322e9b8 (diff)
downloadcpython-2e0419dcd69cab245d30b92a7f442fd4617ca8f8.zip
cpython-2e0419dcd69cab245d30b92a7f442fd4617ca8f8.tar.gz
cpython-2e0419dcd69cab245d30b92a7f442fd4617ca8f8.tar.bz2
Cleaned how _BytesIO.read() returns an empty bytes object.
Thank you, Guido, for noticing!
Diffstat (limited to 'Lib')
-rw-r--r--Lib/io.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/io.py b/Lib/io.py
index a88b5a4..940c4c7 100644
--- a/Lib/io.py
+++ b/Lib/io.py
@@ -794,7 +794,7 @@ class _BytesIO(BufferedIOBase):
if n < 0:
n = len(self._buffer)
if len(self._buffer) <= self._pos:
- return bytes(self._buffer[:0])
+ return b""
newpos = min(len(self._buffer), self._pos + n)
b = self._buffer[self._pos : newpos]
self._pos = newpos