diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2016-04-15 15:52:27 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2016-04-15 15:52:27 (GMT) |
commit | e914d413128e504f4bb4c46315c9afef104388c9 (patch) | |
tree | 8170ba652ef5cb511f6849da643a29ac37b5ce7b /Lib | |
parent | 12bb6f4c7d590e29f7c57d176d4295da4ef4573a (diff) | |
download | cpython-e914d413128e504f4bb4c46315c9afef104388c9.zip cpython-e914d413128e504f4bb4c46315c9afef104388c9.tar.gz cpython-e914d413128e504f4bb4c46315c9afef104388c9.tar.bz2 |
Issue #26766: Fix _PyBytesWriter_Finish()
Return a bytearray object when bytearray is requested and when the small buffer
is used.
Fix also test_bytes: bytearray%args must return a bytearray type.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_bytes.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_bytes.py b/Lib/test/test_bytes.py index 966e287..a10ad5e 100644 --- a/Lib/test/test_bytes.py +++ b/Lib/test/test_bytes.py @@ -492,7 +492,7 @@ class BaseBytesTest: b = self.type2test(b'%s / 100 = %d%%') a = b % (b'seventy-nine', 79) self.assertEqual(a, b'seventy-nine / 100 = 79%') - self.assertIs(type(a), bytes) + self.assertIs(type(a), self.type2test) def test_imod(self): b = self.type2test(b'hello, %b!') @@ -504,7 +504,7 @@ class BaseBytesTest: b = self.type2test(b'%s / 100 = %d%%') b %= (b'seventy-nine', 79) self.assertEqual(b, b'seventy-nine / 100 = 79%') - self.assertIs(type(b), bytes) + self.assertIs(type(b), self.type2test) def test_rmod(self): with self.assertRaises(TypeError): |