Skip to content

Commit cf43859

Browse files
committed
Fix warnings about thread.setDaemon() in python 3.10+
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
1 parent 3532d8d commit cf43859

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

scripts/easy_train.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ def f():
313313
os._exit(errcode)
314314

315315
thread = Thread(target=f)
316-
thread.setDaemon(True)
316+
thread.daemon = True
317317
thread.start()
318318

319319
if sys.platform == "win32":
@@ -499,7 +499,7 @@ def __init__(self, period_seconds):
499499
self._running = True
500500
self._update()
501501

502-
self.setDaemon(True)
502+
self.daemon = True
503503
self.start()
504504

505505
def _update(self):
@@ -2410,7 +2410,7 @@ def f():
24102410
time.sleep(1)
24112411

24122412
thread = Thread(target=f)
2413-
thread.setDaemon(True)
2413+
thread.daemon = True
24142414
thread.start()
24152415

24162416
def main():

0 commit comments

Comments
 (0)