diff options
author | Gregory P. Smith <greg@mad-scientist.com> | 2010-02-28 18:36:09 +0000 |
---|---|---|
committer | Gregory P. Smith <greg@mad-scientist.com> | 2010-02-28 18:36:09 +0000 |
commit | 613c7a549abefd1f7806b61589667de683d76858 (patch) | |
tree | 1a7678d4b102a5dbc66e5822b49c568584e771be /Lib/threading.py | |
parent | b36e63a5ee7b1b8063b59f2be74703471ae45e1d (diff) | |
download | cpython-git-613c7a549abefd1f7806b61589667de683d76858.tar.gz |
Issue #7481: When a threading.Thread failed to start it would leave the
instance stuck in initial state and present in threading.enumerate().
Diffstat (limited to 'Lib/threading.py')
-rw-r--r-- | Lib/threading.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/threading.py b/Lib/threading.py index 56740101ed..c6fb2da07c 100644 --- a/Lib/threading.py +++ b/Lib/threading.py @@ -469,7 +469,12 @@ class Thread(_Verbose): self._note("%s.start(): starting thread", self) with _active_limbo_lock: _limbo[self] = self - _start_new_thread(self.__bootstrap, ()) + try: + _start_new_thread(self.__bootstrap, ()) + except Exception: + with _active_limbo_lock: + del _limbo[self] + raise self.__started.wait() def run(self): |