Skip to content
Snippets Groups Projects
Commit 9d4ab5ea authored by Jesse Nava's avatar Jesse Nava
Browse files

update for current dependencies

parent 13769fa2
No related branches found
No related tags found
No related merge requests found
......@@ -97,7 +97,7 @@ class ExecBot(Plugin):
or not evt.content.formatted_body)):
return
command = EntityParser.parse(evt.content.formatted_body)
command = await EntityParser().parse(evt.content.formatted_body)
entity: SimpleEntity
code: Optional[str] = None
lang: Optional[str] = None
......
......@@ -33,9 +33,9 @@ class AsyncTextOutput:
closed: bool
def __init__(self, loop: Optional[AbstractEventLoop] = None) -> None:
self.loop = loop or get_event_loop()
self.loop = get_event_loop()
self.read_task = None
self.queue = Queue(loop=self.loop)
self.queue = Queue()
self.closed = False
def __aiter__(self) -> 'AsyncTextOutput':
......
......@@ -80,7 +80,7 @@ class ShellRunner(Runner):
) -> AsyncGenerator[Tuple[OutputType, Union[str, int]], None]:
loop = loop or asyncio.get_event_loop()
output = AsyncTextProxy()
proc = await asyncio.create_subprocess_shell(code, loop=loop,
proc = await asyncio.create_subprocess_shell(code,
stdin=asyncio.subprocess.PIPE,
stdout=asyncio.subprocess.PIPE,
stderr=asyncio.subprocess.PIPE)
......@@ -91,6 +91,7 @@ class ShellRunner(Runner):
waiter = asyncio.ensure_future(self._wait_proc(proc, output), loop=loop)
async for part in output:
yield part
print(output)
yield (OutputType.RETURN, await waiter)
def format_exception(self, exc_info: Any) -> Tuple[Optional[str], Optional[str]]:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment