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:
parent
ba94d07e8a
commit
758ba823f2
|
@ -474,7 +474,7 @@ def zuul_run_command(self, args, zuul_log_id, check_rc=False, close_fds=True, ex
|
||||||
if t:
|
if t:
|
||||||
t.join(10)
|
t.join(10)
|
||||||
with Console(zuul_log_id) as console:
|
with Console(zuul_log_id) as console:
|
||||||
if t.isAlive():
|
if t.is_alive():
|
||||||
console.addLine("[Zuul] standard output/error still open "
|
console.addLine("[Zuul] standard output/error still open "
|
||||||
"after child exited")
|
"after child exited")
|
||||||
# ZUUL: stdout and stderr are in the console log file
|
# 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:
|
finally:
|
||||||
if t:
|
if t:
|
||||||
with Console(zuul_log_id) as console:
|
with Console(zuul_log_id) as console:
|
||||||
if t.isAlive():
|
if t.is_alive():
|
||||||
console.addLine("[Zuul] standard output/error still open "
|
console.addLine("[Zuul] standard output/error still open "
|
||||||
"after child exited")
|
"after child exited")
|
||||||
if fail_json_kwargs:
|
if fail_json_kwargs:
|
||||||
|
|
|
@ -181,7 +181,7 @@ class LogStreamer(object):
|
||||||
raise
|
raise
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
if self.thd.isAlive():
|
if self.thd.is_alive():
|
||||||
self.server.shutdown()
|
self.server.shutdown()
|
||||||
self.server.server_close()
|
self.server.server_close()
|
||||||
self.thd.join()
|
self.thd.join()
|
||||||
|
|
Loading…
Reference in New Issue