Commit 02c9a667 authored by Alexandre Vassalotti's avatar Alexandre Vassalotti

Cleaned how _BytesIO.read() returns an empty bytes object.

Thank you, Guido, for noticing!
parent ab2e583f
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment