Skip to content

Commit

Permalink
Fix warnings about thread.setDaemon() in python 3.10+
Browse files Browse the repository at this point in the history
easy_train.py:316: DeprecationWarning: setDaemon() is deprecated,
set the daemon attribute instead thread.setDaemon(True)

camelCase methods in threading were deprecated in:
python/cpython#25174
  • Loading branch information
linrock committed Nov 29, 2022
1 parent bff6194 commit 4160a7e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/easy_train.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ def f():
os._exit(errcode)

thread = Thread(target=f)
thread.setDaemon(True)
thread.daemon = True
thread.start()

if sys.platform == "win32":
Expand Down Expand Up @@ -499,7 +499,7 @@ def __init__(self, period_seconds):
self._running = True
self._update()

self.setDaemon(True)
self.daemon = True
self.start()

def _update(self):
Expand Down Expand Up @@ -2410,7 +2410,7 @@ def f():
time.sleep(1)

thread = Thread(target=f)
thread.setDaemon(True)
thread.daemon = True
thread.start()

def main():
Expand Down

0 comments on commit 4160a7e

Please sign in to comment.