Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2e0419d

Browse files
committed
Cleaned how _BytesIO.read() returns an empty bytes object.
Thank you, Guido, for noticing!
1 parent 8e99760 commit 2e0419d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Lib/io.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -794,7 +794,7 @@ def read(self, n=None):
794794
if n < 0:
795795
n = len(self._buffer)
796796
if len(self._buffer) <= self._pos:
797-
return bytes(self._buffer[:0])
797+
return b""
798798
newpos = min(len(self._buffer), self._pos + n)
799799
b = self._buffer[self._pos : newpos]
800800
self._pos = newpos

0 commit comments

Comments
 (0)