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

@ -451,9 +451,7 @@ class HomeAssistant:
self.import_executor = InterruptibleThreadPoolExecutor(
max_workers=1, thread_name_prefix="ImportExecutor"
)
self.loop_thread_id = getattr(
self.loop, "_thread_ident", getattr(self.loop, "_thread_id")
)
self.loop_thread_id = getattr(self.loop, "_thread_id")
def verify_event_loop_thread(self, what: str) -> None:
"""Report and raise if we are not running in the event loop thread."""