From 1023da405a3a03599755ced519284056fa4f2458 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Fri, 28 Feb 2020 14:44:27 +0100 Subject: [PATCH] More Python 3.9 fixing (can't wait for Python 10.7) --- lib/core/common.py | 2 +- lib/core/threads.py | 2 +- lib/utils/timeout.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/core/common.py b/lib/core/common.py index c053a9f06..a18fbd0ff 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -4007,7 +4007,7 @@ def removeReflectiveValues(content, payload, suppressWarning=False): thread.start() thread.join(REFLECTED_REPLACEMENT_TIMEOUT) - if thread.isAlive(): + if thread.is_alive(): kb.reflectiveMechanism = False retVal = content if not suppressWarning: diff --git a/lib/core/threads.py b/lib/core/threads.py index c717681fe..e782cf76b 100644 --- a/lib/core/threads.py +++ b/lib/core/threads.py @@ -175,7 +175,7 @@ def runThreads(numThreads, threadFunction, cleanupFunction=None, forwardExceptio while alive: alive = False for thread in threads: - if thread.isAlive(): + if thread.is_alive(): alive = True time.sleep(0.1) diff --git a/lib/utils/timeout.py b/lib/utils/timeout.py index 27c716705..6f0e2b198 100644 --- a/lib/utils/timeout.py +++ b/lib/utils/timeout.py @@ -31,7 +31,7 @@ def timeout(func, args=None, kwargs=None, duration=1, default=None): thread.start() thread.join(duration) - if thread.isAlive(): + if thread.is_alive(): return default, TIMEOUT_STATE.TIMEOUT else: return thread.result, thread.timeout_state