summaryrefslogtreecommitdiff
path: root/Lib/test/test_bz2.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_bz2.py')
-rw-r--r--Lib/test/test_bz2.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_bz2.py b/Lib/test/test_bz2.py
index a1e4b8d8e2..450ab2e23a 100644
--- a/Lib/test/test_bz2.py
+++ b/Lib/test/test_bz2.py
@@ -562,11 +562,11 @@ class BZ2FileTest(BaseTest):
def testDecompressLimited(self):
"""Decompressed data buffering should be limited"""
- bomb = bz2.compress(bytes(int(2e6)), compresslevel=9)
+ bomb = bz2.compress(b'\0' * int(2e6), compresslevel=9)
self.assertLess(len(bomb), _compression.BUFFER_SIZE)
decomp = BZ2File(BytesIO(bomb))
- self.assertEqual(bytes(1), decomp.read(1))
+ self.assertEqual(decomp.read(1), b'\0')
max_decomp = 1 + DEFAULT_BUFFER_SIZE
self.assertLessEqual(decomp._buffer.raw.tell(), max_decomp,
"Excessive amount of data was decompressed")