We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
DeprecationWarning
1 parent adc057b commit 27cb5c0Copy full SHA for 27cb5c0
src/prompt_toolkit/application/application.py
@@ -958,7 +958,13 @@ def run_in_thread() -> None:
958
# See whether a loop was installed already. If so, use that. That's
959
# required for the input hooks to work, they are installed using
960
# `set_event_loop`.
961
- loop = asyncio.get_event_loop()
+ if sys.version_info < (3, 10):
962
+ loop = asyncio.get_event_loop()
963
+ else:
964
+ try:
965
+ loop = asyncio.get_running_loop()
966
+ except RuntimeError:
967
+ loop = asyncio.new_event_loop()
968
except RuntimeError:
969
# No loop installed. Run like usual.
970
return asyncio.run(coro)
0 commit comments