Use BaseEventLoop._thread_id instead of a custom attribute (#124054)

Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
Erik Montnemery
2024-08-17 10:59:39 +02:00
committed by GitHub
parent 7deb9bf30f
commit 6c01e4b99c
5 changed files with 7 additions and 12 deletions

View File

@@ -57,7 +57,7 @@ def run_callback_threadsafe[_T, *_Ts](
Return a concurrent.futures.Future to access the result.
"""
if (ident := loop.__dict__.get("_thread_ident")) and ident == threading.get_ident():
if (ident := loop.__dict__.get("_thread_id")) and ident == threading.get_ident():
raise RuntimeError("Cannot be called from within the event loop")
future: concurrent.futures.Future[_T] = concurrent.futures.Future()