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: