From a19c64ce983cfb182c00c19250df0bcc6e127096 Mon Sep 17 00:00:00 2001 From: atse Date: Thu, 22 Aug 2024 16:51:58 +0800 Subject: [PATCH] Remove wait_for OSError raised anyways --- pytec/tec_qt.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/pytec/tec_qt.py b/pytec/tec_qt.py index 58ea46f..06320b0 100755 --- a/pytec/tec_qt.py +++ b/pytec/tec_qt.py @@ -239,17 +239,14 @@ class MainWindow(QtWidgets.QMainWindow): self.conn_menu.port_set_spin.setEnabled(False) self._connecting_task = asyncio.create_task( - asyncio.wait_for( - self.thermostat.start_session( - host=self.conn_menu.host_set_line.text(), - port=self.conn_menu.port_set_spin.value(), - ), - timeout=5, + self.thermostat.start_session( + host=self.conn_menu.host_set_line.text(), + port=self.conn_menu.port_set_spin.value(), ) ) try: await self._connecting_task - except (OSError, asyncio.TimeoutError, asyncio.CancelledError) as exc: + except (OSError, asyncio.CancelledError) as exc: await self.bail() if isinstance(exc, asyncio.CancelledError): return