Skip to content

Commit f21b2aa

Browse files
committed
Thread.__bootstrap(): ignore exceptions in the self.__delete() call in
the finally clause. An exception here could happen when a daemon thread exits after the threading module has already been trashed by the import finalization, and there's not much of a point in trying to insist doing the cleanup in that stage. This should fix SF bug ##497111: active_limbo_lock error at program exit. 2.1.2 and 2.2.1 Bugfix candidate!
1 parent 2764a3a commit f21b2aa

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Lib/threading.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,10 @@ def __bootstrap(self):
421421
self._note("%s.__bootstrap(): normal return", self)
422422
finally:
423423
self.__stop()
424-
self.__delete()
424+
try:
425+
self.__delete()
426+
except:
427+
pass
425428

426429
def __stop(self):
427430
self.__block.acquire()

0 commit comments

Comments
 (0)