Skip to content

Commit 03db68a

Browse files
tacaswelljonathanslenders
authored andcommitted
MNT: Avoid warning on 3.10.9+, 3.11.1+, and 3.12.0+
closes #1696
1 parent 14863ae commit 03db68a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/prompt_toolkit/eventloop/utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,6 @@ def get_event_loop() -> asyncio.AbstractEventLoop:
115115
try:
116116
return getloop()
117117
except RuntimeError:
118-
return asyncio.get_event_loop_policy().get_event_loop()
118+
loop = asyncio.new_event_loop()
119+
asyncio.set_event_loop(loop)
120+
return loop

0 commit comments

Comments
 (0)