From 67ab33ef92fc66e95e6d7f3248085bcc92ca4a5f Mon Sep 17 00:00:00 2001 From: Salad Dais Date: Wed, 10 Jan 2024 18:18:54 +0000 Subject: [PATCH] Maybe fix missing event loop warning --- src/outleap/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/outleap/utils.py b/src/outleap/utils.py index 8151cf3..dca6700 100644 --- a/src/outleap/utils.py +++ b/src/outleap/utils.py @@ -82,7 +82,7 @@ async def _make_hacky_threaded_stdio_rw() -> Tuple[asyncio.StreamReader, asyncio # # TODO: Currently we also use this if we're reading from a non-pipe file descriptor on POSIX # platforms, but that's probably unnecessary. - loop = asyncio.get_event_loop() + loop = asyncio.get_event_loop_policy().get_event_loop() reader = asyncio.StreamReader(limit=_READER_BUFFER_LIMIT) protocol = HackySTDIOProtocol() transport = HackySTDIOTransport() @@ -157,7 +157,7 @@ async def connect_stdin_stdout() -> Tuple[asyncio.StreamReader, asyncio.StreamWr need_stdin_hack = True if need_stdin_hack: return await _make_hacky_threaded_stdio_rw() - loop = asyncio.get_event_loop() + loop = asyncio.get_event_loop_policy().get_event_loop() reader = asyncio.StreamReader(limit=_READER_BUFFER_LIMIT) protocol = asyncio.StreamReaderProtocol(reader) await loop.connect_read_pipe(lambda: protocol, sys.stdin)