From fcf157cdfc86b96e58e0cbb0fcb9e725f9aa5731 Mon Sep 17 00:00:00 2001 From: David Rose Date: Wed, 12 Nov 2008 18:43:29 +0000 Subject: [PATCH] cleaner shutdown --- direct/src/stdpy/threading.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/direct/src/stdpy/threading.py b/direct/src/stdpy/threading.py index de4960d225..99c8dc7df5 100644 --- a/direct/src/stdpy/threading.py +++ b/direct/src/stdpy/threading.py @@ -103,7 +103,9 @@ class Thread(ThreadBase): self.__dict__['ident'] = threadId def __del__(self): - if _thread: + # On interpreter shutdown, the _thread module might have + # already been cleaned up. + if _thread and _thread._remove_thread_id: _thread._remove_thread_id(self.ident) def start(self):