From c4a94bc99285aba085badeb1a41e8fe04562ef50 Mon Sep 17 00:00:00 2001
From: Xavier Morel <xmo@odoo.com>
Date: Fri, 16 Oct 2020 13:58:26 +0000
Subject: [PATCH] [FIX] core: Thread.isAlive -> Thread.is_alive

Old naming has been deprecated for a long time, it's been removed
entirely in 3.9 (bpo-37804).
---
 addons/hw_escpos/controllers/main.py | 2 +-
 odoo/service/server.py               | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/addons/hw_escpos/controllers/main.py b/addons/hw_escpos/controllers/main.py
index 123a8a41cec0..b1a015763f9e 100644
--- a/addons/hw_escpos/controllers/main.py
+++ b/addons/hw_escpos/controllers/main.py
@@ -92,7 +92,7 @@ class EscposDriver(Thread):
 
     def lockedstart(self):
         with self.lock:
-            if not self.isAlive():
+            if not self.is_alive():
                 self.daemon = True
                 self.start()
     
diff --git a/odoo/service/server.py b/odoo/service/server.py
index 4cd650cb0bb6..cff0a3f88963 100644
--- a/odoo/service/server.py
+++ b/odoo/service/server.py
@@ -391,7 +391,7 @@ class ThreadedServer(CommonServer):
         # e.g. threads that exceeded their real time,
         # but which finished before the server could restart.
         for thread in list(self.limits_reached_threads):
-            if not thread.isAlive():
+            if not thread.is_alive():
                 self.limits_reached_threads.remove(thread)
         if self.limits_reached_threads:
             self.limit_reached_time = self.limit_reached_time or time.time()
@@ -489,7 +489,7 @@ class ThreadedServer(CommonServer):
             _logger.debug('process %r (%r)', thread, thread.isDaemon())
             if (thread != me and not thread.isDaemon() and thread.ident != self.main_thread_id and
                     thread not in self.limits_reached_threads):
-                while thread.isAlive() and (time.time() - stop_time) < 1:
+                while thread.is_alive() and (time.time() - stop_time) < 1:
                     # We wait for requests to finish, up to 1 second.
                     _logger.debug('join and sleep')
                     # Need a busyloop here as thread.join() masks signals
-- 
GitLab