From 16f3e81384676b41f42d81a0919d07839500b80d Mon Sep 17 00:00:00 2001 From: atse Date: Thu, 22 Aug 2024 16:08:54 +0800 Subject: [PATCH] Raise if OSError --- pytec/tec_qt.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pytec/tec_qt.py b/pytec/tec_qt.py index 2a1e21f..f088c5a 100755 --- a/pytec/tec_qt.py +++ b/pytec/tec_qt.py @@ -257,9 +257,11 @@ class MainWindow(QtWidgets.QMainWindow): ) try: await self._connecting_task - except (OSError, asyncio.TimeoutError, asyncio.CancelledError): + except (OSError, asyncio.TimeoutError, asyncio.CancelledError) as exc: await self.bail() - return + if isinstance(exc, asyncio.CancelledError): + return + raise else: await self._on_connection_changed(True) finally: