From 2e0419dcd69cab245d30b92a7f442fd4617ca8f8 Mon Sep 17 00:00:00 2001 From: Alexandre Vassalotti Date: Wed, 7 May 2008 00:09:04 +0000 Subject: [PATCH] Cleaned how _BytesIO.read() returns an empty bytes object. Thank you, Guido, for noticing! --- Lib/io.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/io.py b/Lib/io.py index a88b5a41fe..940c4c776c 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 -- 2.50.1