Use is_alive in favor of deprecated isAlive
This commit is contained in:
parent
bdc7072176
commit
1722f34da2
@ -38,7 +38,7 @@ class StoppableThread(threading.Thread):
|
|||||||
'''
|
'''
|
||||||
_stopThread - @see StoppableThread.stop
|
_stopThread - @see StoppableThread.stop
|
||||||
'''
|
'''
|
||||||
if self.isAlive() is False:
|
if self.is_alive() is False:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
self._stderr = open(os.devnull, 'w')
|
self._stderr = open(os.devnull, 'w')
|
||||||
@ -120,7 +120,7 @@ class JoinThread(threading.Thread):
|
|||||||
# If py2, call this first to start thread termination cleanly.
|
# If py2, call this first to start thread termination cleanly.
|
||||||
# Python3 does not need such ( nor does it provide.. )
|
# Python3 does not need such ( nor does it provide.. )
|
||||||
self.otherThread._Thread__stop()
|
self.otherThread._Thread__stop()
|
||||||
while self.otherThread.isAlive():
|
while self.otherThread.is_alive():
|
||||||
# We loop raising exception incase it's caught hopefully this breaks us far out.
|
# We loop raising exception incase it's caught hopefully this breaks us far out.
|
||||||
ctypes.pythonapi.PyThreadState_SetAsyncExc(ctypes.c_long(self.otherThread.ident), ctypes.py_object(self.exception))
|
ctypes.pythonapi.PyThreadState_SetAsyncExc(ctypes.c_long(self.otherThread.ident), ctypes.py_object(self.exception))
|
||||||
self.otherThread.join(self.repeatEvery)
|
self.otherThread.join(self.repeatEvery)
|
||||||
|
|||||||
@ -86,7 +86,7 @@ def func_timeout(timeout, func, args=(), kwargs=None):
|
|||||||
thread.join(timeout)
|
thread.join(timeout)
|
||||||
|
|
||||||
stopException = None
|
stopException = None
|
||||||
if thread.isAlive():
|
if thread.is_alive():
|
||||||
isStopped = True
|
isStopped = True
|
||||||
|
|
||||||
class FunctionTimedOutTempType(FunctionTimedOut):
|
class FunctionTimedOutTempType(FunctionTimedOut):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user