diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2012-04-19 21:55:01 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2012-04-19 21:55:01 (GMT) |
commit | 52849bfaa384f1dcc26a8aa9092379921d835081 (patch) | |
tree | cf97e23e85810217b86808d64b5188288129fd6e /Lib/threading.py | |
parent | c45868ec697a70a80d1cf8a511894f073fda3a27 (diff) | |
download | cpython-52849bfaa384f1dcc26a8aa9092379921d835081.zip cpython-52849bfaa384f1dcc26a8aa9092379921d835081.tar.gz cpython-52849bfaa384f1dcc26a8aa9092379921d835081.tar.bz2 |
Issue #14308: Fix an exception when a "dummy" thread is in the threading module's active list after a fork().
Diffstat (limited to 'Lib/threading.py')
-rw-r--r-- | Lib/threading.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/threading.py b/Lib/threading.py index ff32dfb..2290855 100644 --- a/Lib/threading.py +++ b/Lib/threading.py @@ -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() |