Skip to content

Commit

Permalink
Maybe fix missing event loop warning
Browse files Browse the repository at this point in the history
  • Loading branch information
SaladDais committed Jan 10, 2024
1 parent 4786b2b commit 67ab33e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/outleap/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 67ab33e

Please sign in to comment.