Compacting

This commit is contained in:
atse 2024-08-22 12:25:11 +08:00
parent b0c30d128e
commit 23f484e3d8

View File

@ -259,19 +259,17 @@ class MainWindow(QtWidgets.QMainWindow):
)
try:
await self._connecting_task
except (OSError, asyncio.TimeoutError):
except (OSError, asyncio.TimeoutError, asyncio.CancelledError):
await self.bail()
return
except asyncio.CancelledError:
return
else:
await self._on_connection_changed(True)
finally:
self._connecting_task = None
elif self._connecting_task is not None:
self._connecting_task.cancel()
else:
if self._connecting_task is not None:
self._connecting_task.cancel()
await self.bail()
@asyncSlot()