summaryrefslogtreecommitdiffstats
path: root/Lib/threading.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/threading.py')
-rw-r--r--Lib/threading.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/threading.py b/Lib/threading.py
index 4bb0182..c996f42 100644
--- a/Lib/threading.py
+++ b/Lib/threading.py
@@ -455,7 +455,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):