From 27178c147868c5dadce4decef4164d34f7071509 Mon Sep 17 00:00:00 2001 From: Simon Renblad Date: Wed, 6 Mar 2024 16:32:22 +0800 Subject: [PATCH] moninj: remove CancelledError workaround --- artiq/coredevice/comm_moninj.py | 4 +--- artiq/dashboard/moninj.py | 5 +---- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/artiq/coredevice/comm_moninj.py b/artiq/coredevice/comm_moninj.py index e02da526c..1de7f50df 100644 --- a/artiq/coredevice/comm_moninj.py +++ b/artiq/coredevice/comm_moninj.py @@ -94,9 +94,7 @@ class CommMonInj: self.injection_status_cb(channel, override, value) else: raise ValueError("Unknown packet type", ty) - except asyncio.CancelledError: - raise - except: + except Exception: logger.error("Moninj connection terminating with exception", exc_info=True) finally: if self.disconnect_cb is not None: diff --git a/artiq/dashboard/moninj.py b/artiq/dashboard/moninj.py index 4810f4d34..c3fc75dee 100644 --- a/artiq/dashboard/moninj.py +++ b/artiq/dashboard/moninj.py @@ -719,10 +719,7 @@ class _DeviceManager: self.disconnect_cb) try: await new_mi_connection.connect(self.mi_addr, self.mi_port) - except asyncio.CancelledError: - logger.info("cancelled connection to moninj") - break - except: + except Exception: logger.error("failed to connect to moninj. Is aqctl_moninj_proxy running?", exc_info=True) await asyncio.sleep(10.) self.reconnect_mi.set()