Skip to content

Commit

Permalink
pythongh-106176: Fix reference leak in importlib/_bootstrap.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Eclips4 committed Jun 28, 2023
1 parent a3dd8cc commit 5328e32
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Lib/importlib/_bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ def __enter__(self):
def __exit__(self, *args, **kwargs):
"""Remove self.lock from this thread's _blocking_on list."""
self.blocked_on.remove(self.lock)
if not self.blocked_on:
del _blocking_on[self.thread_id]


class _DeadlockError(RuntimeError):
Expand Down

0 comments on commit 5328e32

Please sign in to comment.