Blame 0001-Replace-deprecated-Thread.isAlive-with-Thread.is_ali.patch

c6b7f7e
From b27dc5df5dc1617fc2f1d438611b87b3e63383c4 Mon Sep 17 00:00:00 2001
c6b7f7e
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
c6b7f7e
Date: Mon, 1 Jun 2020 12:49:07 +0200
c6b7f7e
Subject: [PATCH] Replace deprecated Thread.isAlive() with Thread.is_alive()
c6b7f7e
c6b7f7e
The isAlive() method of threading.Thread has been removed in Python 3.9.
c6b7f7e
The is_alive() method is available on Python 2.6+.
c6b7f7e
c6b7f7e
See https://bugs.python.org/issue37804
c6b7f7e
c6b7f7e
Change-Id: I951b1ae331c3101722fe34babf81d6f82d838380
c6b7f7e
---
c6b7f7e
 zuul/ansible/base/library/command.py | 4 ++--
c6b7f7e
 zuul/lib/log_streamer.py             | 2 +-
c6b7f7e
 2 files changed, 3 insertions(+), 3 deletions(-)
c6b7f7e
c6b7f7e
diff --git a/zuul/ansible/base/library/command.py b/zuul/ansible/base/library/command.py
c6b7f7e
index a3b969d9..0c461b3a 100755
c6b7f7e
--- a/zuul/ansible/base/library/command.py
c6b7f7e
+++ b/zuul/ansible/base/library/command.py
c6b7f7e
@@ -474,7 +474,7 @@ def zuul_run_command(self, args, zuul_log_id, check_rc=False, close_fds=True, ex
c6b7f7e
         if t:
c6b7f7e
             t.join(10)
c6b7f7e
             with Console(zuul_log_id) as console:
c6b7f7e
-                if t.isAlive():
c6b7f7e
+                if t.is_alive():
c6b7f7e
                     console.addLine("[Zuul] standard output/error still open "
c6b7f7e
                                     "after child exited")
c6b7f7e
             # ZUUL: stdout and stderr are in the console log file
c6b7f7e
@@ -495,7 +495,7 @@ def zuul_run_command(self, args, zuul_log_id, check_rc=False, close_fds=True, ex
c6b7f7e
     finally:
c6b7f7e
         if t:
c6b7f7e
             with Console(zuul_log_id) as console:
c6b7f7e
-                if t.isAlive():
c6b7f7e
+                if t.is_alive():
c6b7f7e
                     console.addLine("[Zuul] standard output/error still open "
c6b7f7e
                                     "after child exited")
c6b7f7e
                 if fail_json_kwargs:
c6b7f7e
diff --git a/zuul/lib/log_streamer.py b/zuul/lib/log_streamer.py
c6b7f7e
index 16b72227..9ed124c5 100644
c6b7f7e
--- a/zuul/lib/log_streamer.py
c6b7f7e
+++ b/zuul/lib/log_streamer.py
c6b7f7e
@@ -181,7 +181,7 @@ class LogStreamer(object):
c6b7f7e
             raise
c6b7f7e
 
c6b7f7e
     def stop(self):
c6b7f7e
-        if self.thd.isAlive():
c6b7f7e
+        if self.thd.is_alive():
c6b7f7e
             self.server.shutdown()
c6b7f7e
             self.server.server_close()
c6b7f7e
             self.thd.join()
c6b7f7e
-- 
c6b7f7e
2.25.4
c6b7f7e