Skip to content

Commit 5b9b907

Browse files
committed
Fix refleak at test suite level
1 parent 707db41 commit 5b9b907

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Lib/importlib/_bootstrap.py

-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ def __exit__(self, *args, **kwargs):
8686
"""Remove self.lock from this thread's _blocking_on list."""
8787
self.blocked_on.remove(self.lock)
8888

89-
9089
class _DeadlockError(RuntimeError):
9190
pass
9291

Lib/test/test_importlib/test_locks.py

+5
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ class ModuleLockAsRLockTests:
3333
test_repr = None
3434
test_locked_repr = None
3535

36+
def tearDown(self):
37+
for splitinit in init.values():
38+
splitinit._bootstrap._blocking_on.clear()
39+
40+
3641
LOCK_TYPES = {kind: splitinit._bootstrap._ModuleLock
3742
for kind, splitinit in init.items()}
3843

0 commit comments

Comments
 (0)