mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Cleaned how _BytesIO.read() returns an empty bytes object.
Thank you, Guido, for noticing!
This commit is contained in:
parent
8e99760c90
commit
2e0419dcd6
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue