From 1722f34da22ea0f3bfde47899e7ce27c41153c48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Florczak?= Date: Mon, 19 Aug 2019 12:01:00 +0200 Subject: [PATCH] Use is_alive in favor of deprecated isAlive --- func_timeout/StoppableThread.py | 4 ++-- func_timeout/dafunc.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/func_timeout/StoppableThread.py b/func_timeout/StoppableThread.py index 780dc63..9b8bb3b 100644 --- a/func_timeout/StoppableThread.py +++ b/func_timeout/StoppableThread.py @@ -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) diff --git a/func_timeout/dafunc.py b/func_timeout/dafunc.py index 9227351..681a01c 100644 --- a/func_timeout/dafunc.py +++ b/func_timeout/dafunc.py @@ -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):