Merge pull request #7 from florczakraf/use_is_alive

Use is_alive in favor of isAlive
This commit is contained in:
Tim Savannah 2019-08-19 16:22:00 -04:00 committed by GitHub
commit caffd41f95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -38,7 +38,7 @@ class StoppableThread(threading.Thread):
'''
_stopThread - @see StoppableThread.stop
'''
if self.isAlive() is False:
if self.is_alive() is False:
return True
self._stderr = open(os.devnull, 'w')
@ -120,7 +120,7 @@ class JoinThread(threading.Thread):
# If py2, call this first to start thread termination cleanly.
# Python3 does not need such ( nor does it provide.. )
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.
ctypes.pythonapi.PyThreadState_SetAsyncExc(ctypes.c_long(self.otherThread.ident), ctypes.py_object(self.exception))
self.otherThread.join(self.repeatEvery)

View File

@ -86,7 +86,7 @@ def func_timeout(timeout, func, args=(), kwargs=None):
thread.join(timeout)
stopException = None
if thread.isAlive():
if thread.is_alive():
isStopped = True
class FunctionTimedOutTempType(FunctionTimedOut):