From 03a1fdaaf5ab06dc36a2e663bdc1deda46431857 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Sat, 11 Jul 2020 16:22:38 +0300 Subject: [PATCH] Stop passing loop to asyncio.gather --- maubot/__main__.py | 5 ++--- maubot/client.py | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/maubot/__main__.py b/maubot/__main__.py index a9939a6..de78526 100644 --- a/maubot/__main__.py +++ b/maubot/__main__.py @@ -73,13 +73,12 @@ try: log.info("Starting server") loop.run_until_complete(server.start()) log.info("Starting clients and plugins") - loop.run_until_complete(asyncio.gather(*[client.start() for client in clients], loop=loop)) + loop.run_until_complete(asyncio.gather(*[client.start() for client in clients])) log.info("Startup actions complete, running forever") loop.run_forever() except KeyboardInterrupt: log.info("Interrupt received, stopping clients") - loop.run_until_complete(asyncio.gather(*[client.stop() for client in Client.cache.values()], - loop=loop)) + loop.run_until_complete(asyncio.gather(*[client.stop() for client in Client.cache.values()])) if stop_log_listener is not None: log.debug("Closing websockets") loop.run_until_complete(stop_log_listener()) diff --git a/maubot/client.py b/maubot/client.py index 52d88dc..6eab38a 100644 --- a/maubot/client.py +++ b/maubot/client.py @@ -137,11 +137,10 @@ class Client: await self.start_plugins() async def start_plugins(self) -> None: - await asyncio.gather(*[plugin.start() for plugin in self.references], loop=self.loop) + await asyncio.gather(*[plugin.start() for plugin in self.references]) async def stop_plugins(self) -> None: - await asyncio.gather(*[plugin.stop() for plugin in self.references if plugin.started], - loop=self.loop) + await asyncio.gather(*[plugin.stop() for plugin in self.references if plugin.started]) def start_sync(self) -> None: if self.sync: