Skip to content

Commit

Permalink
Account for handles being cleared after fork
Browse files Browse the repository at this point in the history
  • Loading branch information
mpage committed Feb 10, 2024
1 parent 7f9720d commit 092c2eb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Lib/threading.py
Original file line number Diff line number Diff line change
Expand Up @@ -1162,7 +1162,9 @@ def join(self, timeout=None):
self._join_os_thread()

def _join_os_thread(self):
self._handle.join()
# self._handle may be cleared post-fork
if self._handle is not None:
self._handle.join()

def _wait_for_tstate_lock(self, block=True, timeout=-1):
# Issue #18808: wait for the thread state to be gone.
Expand Down

0 comments on commit 092c2eb

Please sign in to comment.