We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
python
Learn more about funding links in repositories.
Report abuse
1 parent eb0c485 commit 6ff177aCopy full SHA for 6ff177a
Lib/importlib/_bootstrap.py
@@ -85,6 +85,10 @@ 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
93
94
class _DeadlockError(RuntimeError):
0 commit comments