Compacting

This commit is contained in:
atse 2024-08-22 12:25:11 +08:00
parent 16369cec71
commit f7665ea736

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()