mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #13809: Make bz2 module work with threads disabled.
Original patch by Amaury Forgeot d'Arc.
This commit is contained in:
parent
7422b22e5e
commit
72750a85f9
3 changed files with 16 additions and 2 deletions
|
@ -463,6 +463,13 @@ class BZ2FileTest(BaseTest):
|
|||
for t in threads:
|
||||
t.join()
|
||||
|
||||
def testWithoutThreading(self):
|
||||
bz2 = support.import_fresh_module("bz2", blocked=("threading",))
|
||||
with bz2.BZ2File(self.filename, "wb") as f:
|
||||
f.write(b"abc")
|
||||
with bz2.BZ2File(self.filename, "rb") as f:
|
||||
self.assertEqual(f.read(), b"abc")
|
||||
|
||||
def testMixedIterationAndReads(self):
|
||||
self.createTempFile()
|
||||
linelen = len(self.TEXT_LINES[0])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue