Skip to content

Commit 0324713

Browse files
committed
use name property of thread instead of getName and setName
1 parent daeb993 commit 0324713

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

robotcode/utils/async_tools.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,12 +340,12 @@ async def create_inner_task(coro: Callable[..., Coroutine[Any, Any, _T]], *args:
340340

341341
def run(coro: Callable[..., Coroutine[Any, Any, _T]], *args: Any, **kwargs: Any) -> _T:
342342

343-
old_name = threading.current_thread().getName()
343+
old_name = threading.current_thread().name
344344
threading.current_thread().setName(coro.__qualname__)
345345
try:
346346
return asyncio.run(create_inner_task(coro, *args, **kwargs))
347347
finally:
348-
threading.current_thread().setName(old_name)
348+
threading.current_thread().name = old_name
349349

350350
# loop = asyncio.new_event_loop()
351351

0 commit comments

Comments
 (0)