Fix AttributeError in setDaemon in threading module

This commit is contained in:
rdb 2016-04-01 10:44:07 +02:00
parent 461b231a2e
commit 35ef92f8da
1 changed files with 12 additions and 6 deletions

View File

@ -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