1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Fix deadlock at shutdown with python 3.9 (#52613)

This commit is contained in:
J. Nick Koston
2021-07-07 02:23:24 -05:00
committed by GitHub
parent 88cd7f481d
commit 1ba5c1c9fb
3 changed files with 7 additions and 17 deletions

View File

@@ -62,7 +62,7 @@ def join_or_interrupt_threads(
class InterruptibleThreadPoolExecutor(ThreadPoolExecutor):
"""A ThreadPoolExecutor instance that will not deadlock on shutdown."""
def logged_shutdown(self) -> None:
def shutdown(self, *args, **kwargs) -> None: # type: ignore
"""Shutdown backport from cpython 3.9 with interrupt support added."""
with self._shutdown_lock: # type: ignore[attr-defined]
self._shutdown = True