From 7ec6c7ab8bb135ade3d12f392a4cce3c7096bed4 Mon Sep 17 00:00:00 2001 From: Gunnar Aastrand Grimnes Date: Fri, 15 Dec 2023 16:35:02 +0100 Subject: [PATCH] allow cancelled error to bubble up, fixes #48 --- pytonlib/tonlibjson.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pytonlib/tonlibjson.py b/pytonlib/tonlibjson.py index 09cd97a..5b6439b 100644 --- a/pytonlib/tonlibjson.py +++ b/pytonlib/tonlibjson.py @@ -205,6 +205,8 @@ async def read_results(self): result = None try: result = await asyncio.wait_for(self.loop.run_in_executor(None, receive_func), timeout=timeout + delta) + except asyncio.CancelledError: + raise except asyncio.TimeoutError: logger.critical(f"Tonlib #{self.ls_index:03d} stuck (timeout error)") self._state = "stuck"