Browse Source

Fix AttributeError in setDaemon in threading module

rdb 9 years ago
parent
commit
35ef92f8da
1 changed files with 12 additions and 6 deletions
  1. 12 6
      direct/src/stdpy/threading.py

+ 12 - 6
direct/src/stdpy/threading.py

@@ -53,12 +53,6 @@ class ThreadBase:
     def getName(self):
         return self.name
 
-    def is_alive(self):
-        return self.__thread.isStarted()
-
-    def isAlive(self):
-        return self.__thread.isStarted()
-
     def isDaemon(self):
         return self.daemon
 
@@ -115,6 +109,12 @@ class Thread(ThreadBase):
         if _thread and _thread._remove_thread_id:
             _thread._remove_thread_id(self.ident)
 
+    def is_alive(self):
+        return self.__thread.isStarted()
+
+    def isAlive(self):
+        return self.__thread.isStarted()
+
     def start(self):
         if self.__thread.isStarted():
             raise RuntimeError
@@ -152,6 +152,12 @@ class ExternalThread(ThreadBase):
         self.__dict__['name'] = self.__thread.getName()
         self.__dict__['ident'] = threadId
 
+    def is_alive(self):
+        return self.__thread.isStarted()
+
+    def isAlive(self):
+        return self.__thread.isStarted()
+
     def start(self):
         raise RuntimeError