Fix deprecated threading.getName()

threading.getName() is deprecated as for Python 3.10. Use name attribute "threading.name" instead.

https://stackoverflow.com/a/69656065
https://stackoverflow.com/a/69656065
This commit is contained in:
F̷N̷ 2023-06-10 07:56:34 +07:00 committed by GitHub
parent 9811ac51aa
commit c9bfdf391f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -237,11 +237,11 @@ def start_thread(func, *a, **k):
""" run function in a new thread """ run function in a new thread
""" """
th = threading.Thread(target=func, args=a, kwargs=k, daemon=True) th = threading.Thread(target=func, args=a, kwargs=k, daemon=True)
th_name = th.getName() th_name = th.name
if debug_threading: if debug_threading:
log('Starting {} from {}'.format( log('Starting {} from {}'.format(
th_name, threading.current_thread().getName() th_name, threading.current_thread().name
)) ))
try: try: