Skip to content

Commit

Permalink
only shutdown the default executor on 3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
graingert committed Oct 14, 2023
1 parent 12c6f54 commit a7b7ebc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion uvicorn/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ def asyncio_run(
try:
_cancel_all_tasks(loop)
loop.run_until_complete(loop.shutdown_asyncgens())
loop.run_until_complete(loop.shutdown_default_executor())
if sys.version_info >= (3, 9):
loop.run_until_complete(loop.shutdown_default_executor())
finally:
if loop_factory is None:
asyncio.set_event_loop(None)
Expand Down

0 comments on commit a7b7ebc

Please sign in to comment.