Core code styling improvements (#85963)

This commit is contained in:
Franck Nijhof
2023-01-15 23:00:51 +01:00
committed by GitHub
parent 8e5236528f
commit 64c2340fab
13 changed files with 106 additions and 53 deletions

View File

@ -8,7 +8,9 @@ from .util.async_ import protect_loop
def enable() -> None:
"""Enable the detection of blocking calls in the event loop."""
# Prevent urllib3 and requests doing I/O in event loop
HTTPConnection.putrequest = protect_loop(HTTPConnection.putrequest) # type: ignore[assignment]
HTTPConnection.putrequest = protect_loop( # type: ignore[assignment]
HTTPConnection.putrequest
)
# Prevent sleeping in event loop. Non-strict since 2022.02
time.sleep = protect_loop(time.sleep, strict=False)