Skip to content

Commit

Permalink
shutdown_asyncgens is 3.9 only
Browse files Browse the repository at this point in the history
  • Loading branch information
graingert committed Jan 9, 2025
1 parent 84ac43e commit a2ab55a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/prompt_toolkit/application/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,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 a2ab55a

Please sign in to comment.