Prevent time.sleep calls from blocking the event loop (#118561)

* Prevent time.sleep calls from blocking the event loop

We have been warning on these since Jan 2022. 2+ years seems more than enough
time to give to fix these. see https://github.com/home-assistant/core/pull/63766

* Prevent time.sleep calls from blocking the event loop

We have been warning on these since Jan 2022. 2+ years seems more than enough
time to give to fix these. see https://github.com/home-assistant/core/pull/63766
This commit is contained in:
J. Nick Koston 2024-05-31 10:08:22 -05:00 committed by GitHub
parent 15f726da50
commit 1fef4fa1f6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -52,10 +52,9 @@ def enable() -> None:
HTTPConnection.putrequest, loop_thread_id=loop_thread_id
)
# Prevent sleeping in event loop. Non-strict since 2022.02
# Prevent sleeping in event loop.
time.sleep = protect_loop(
time.sleep,
strict=False,
check_allowed=_check_sleep_call_allowed,
loop_thread_id=loop_thread_id,
)