Skip to content

Commit

Permalink
[FIX] core: Thread.isAlive -> Thread.is_alive
Browse files Browse the repository at this point in the history
Old naming has been deprecated for a long time, it's been removed
entirely in 3.9 (bpo-37804).
  • Loading branch information
xmo-odoo authored and ThomasBinsfeld committed Jul 20, 2023
1 parent 2a433d4 commit 20bc3c8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion addons/hw_escpos/controllers/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def __call__(self, device):

def lockedstart(self):
with self.lock:
if not self.isAlive():
if not self.is_alive():
self.daemon = True
self.start()

Expand Down
4 changes: 2 additions & 2 deletions odoo/service/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ def process_limit(self):
# 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()
Expand Down Expand Up @@ -488,7 +488,7 @@ def stop(self):
_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
Expand Down

0 comments on commit 20bc3c8

Please sign in to comment.