Replace deprecated Thread.isAlive() with Thread.is_alive()

The isAlive() method of threading.Thread has been removed in Python 3.9.
The is_alive() method is available on Python 2.6+.

See https://bugs.python.org/issue37804

Change-Id: I951b1ae331c3101722fe34babf81d6f82d838380
This commit is contained in:
Miro Hrončok
2020-06-01 12:49:07 +02:00
parent ba94d07e8a
commit 758ba823f2
2 changed files with 3 additions and 3 deletions

View File

@@ -474,7 +474,7 @@ def zuul_run_command(self, args, zuul_log_id, check_rc=False, close_fds=True, ex
if t:
t.join(10)
with Console(zuul_log_id) as console:
if t.isAlive():
if t.is_alive():
console.addLine("[Zuul] standard output/error still open "
"after child exited")
# ZUUL: stdout and stderr are in the console log file
@@ -495,7 +495,7 @@ def zuul_run_command(self, args, zuul_log_id, check_rc=False, close_fds=True, ex
finally:
if t:
with Console(zuul_log_id) as console:
if t.isAlive():
if t.is_alive():
console.addLine("[Zuul] standard output/error still open "
"after child exited")
if fail_json_kwargs: