Commits

Alexandre Vassalotti committed 8b931a7

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

Thank you, Guido, for noticing!

Comments (0)

Files changed (1)

         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