diff --git a/async-bot.py b/async-bot.py index 5d27064..ccf7d69 100644 --- a/async-bot.py +++ b/async-bot.py @@ -10,6 +10,7 @@ from random import choice, randint from json import load from time import time as time_now import datetime +from contextlib import suppress PixelMap = NewType("PixelMap", dict[int, bool]) @@ -256,10 +257,8 @@ class AsyncBotManager: await sio.emit("toggle_bit", {"index": index}) await asyncio.sleep(delay) self._active.add(bot_index) - try: + with suppress(): await sio.receive(0.1) - except TimeoutError: - pass async def __aenter__(self): self._listener_task = asyncio.create_task(self.listener()) @@ -412,12 +411,10 @@ async def amain() -> None: ) for i in range(settings["n_bots"]) ], - return_exceptions=True, ) else: res = await asyncio.gather( *[mgr.writer(i, None, settings["delay"]) for i in range(settings["n_bots"])], - return_exceptions=True, ) for ret in res: