Issue #14308: Fix an exception when a "dummy" thread is in the threading module's active list after a fork().

This commit is contained in:
Antoine Pitrou 2012-04-19 23:55:01 +02:00
parent c45868ec69
commit 52849bfaa3
3 changed files with 36 additions and 0 deletions

View file

@ -605,6 +605,10 @@ class Thread(_Verbose):
pass
def __stop(self):
# DummyThreads delete self.__block, but they have no waiters to
# notify anyway (join() is forbidden on them).
if not hasattr(self, '_Thread__block'):
return
self.__block.acquire()
self.__stopped = True
self.__block.notify_all()