Browse Source

cleaner shutdown

David Rose 17 years ago
parent
commit
fcf157cdfc
1 changed files with 3 additions and 1 deletions
  1. 3 1
      direct/src/stdpy/threading.py

+ 3 - 1
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):