mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
Fixed a small bug introduced by r62778.
One of the codepaths of _BytesIO.read() returned a bytearray object, by mistake, when it should always return a bytes object. Interestingly, the fact this bug shown up probably means that some platforms are not using the new C-accelerated io.BytesIO.
This commit is contained in:
parent
8dc226fccd
commit
4833b3c37f
2 changed files with 3 additions and 1 deletions
|
@ -114,6 +114,8 @@ class MemoryTestMixin:
|
|||
self.assertEqual(memio.read(-1), buf)
|
||||
memio.seek(0)
|
||||
self.assertEqual(type(memio.read()), type(buf))
|
||||
memio.seek(100)
|
||||
self.assertEqual(type(memio.read()), type(buf))
|
||||
memio.seek(0)
|
||||
self.assertEqual(memio.read(None), buf)
|
||||
self.assertRaises(TypeError, memio.read, '')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue