Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Lib/importlib/_bootstrap.py
Original file line numberDiff line numberDiff 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]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just have one question, is this always true?

assertself.blocked_onis_blocking_on[self.thread_id]

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, if it were sometimes is not true, self.blocked_on.remove(...) will fail, no?
Though, currently test suite didn't failed with new assert check.

Copy link
Member

@sunmy2019sunmy2019Jun 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #101942 (comment)

It may not be True under certain circumstances.



class _DeadlockError(RuntimeError):
Expand Down