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: try:
await self._connecting_task await self._connecting_task
except (OSError, asyncio.TimeoutError): except (OSError, asyncio.TimeoutError, asyncio.CancelledError):
await self.bail() await self.bail()
return return
except asyncio.CancelledError:
return
else: else:
await self._on_connection_changed(True) await self._on_connection_changed(True)
finally: finally:
self._connecting_task = None self._connecting_task = None
elif self._connecting_task is not None:
self._connecting_task.cancel()
else: else:
if self._connecting_task is not None:
self._connecting_task.cancel()
await self.bail() await self.bail()
@asyncSlot() @asyncSlot()