From 632ee8bfa3f533b3d9cc361de6c0a10a5684420e 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 | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pytec/tec_qt.py b/pytec/tec_qt.py index aba8149..58e59ae 100755 --- a/pytec/tec_qt.py +++ b/pytec/tec_qt.py @@ -251,13 +251,11 @@ class MainWindow(QtWidgets.QMainWindow): port = self.conn_menu.port_set_spin.value() self._connecting_task = asyncio.create_task( - asyncio.wait_for( - self.thermostat.start_session(host=host, port=port), timeout=5 - ) + self.thermostat.start_session(host=host, port=port) ) 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