From 506d350d7fd7f0034e6e4ee99e6ebaab70219049 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 af03f9c..aba8149 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: