We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3c0a31c commit 775f881Copy full SHA for 775f881
Lib/importlib/_bootstrap.py
@@ -85,6 +85,11 @@ def __enter__(self):
85
def __exit__(self, *args, **kwargs):
86
"""Remove self.lock from this thread's _blocking_on list."""
87
self.blocked_on.remove(self.lock)
88
+ if len(self.blocked_on) == 0:
89
+ # gh-101766: glboal cache should be cleaned-up
90
+ # if there is no more _blocking_on for this thread.
91
+ del _blocking_on[self.thread_id]
92
+ del self.blocked_on
93
94
95
class _DeadlockError(RuntimeError):
0 commit comments