Skip to content

Commit

Permalink
Use get_running_loop instead of get_event_loop
Browse files Browse the repository at this point in the history
The latter is deprecated and may not always return the running event loop.
  • Loading branch information
auxsvr authored Dec 7, 2023
1 parent 3e71b1e commit 38a3024
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/prompt_toolkit/application/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -985,7 +985,7 @@ def _called_from_ipython() -> bool:
# See whether a loop was installed already. If so, use that.
# That's required for the input hooks to work, they are
# installed using `set_event_loop`.
loop = asyncio.get_event_loop()
loop = asyncio.get_running_loop()
except RuntimeError:
# No loop installed. Run like usual.
return asyncio.run(coro)
Expand Down

0 comments on commit 38a3024

Please sign in to comment.