forked from M-Labs/thermostat
Remove wait_for
OSError raised anyways
This commit is contained in:
parent
0107ed0acc
commit
a19c64ce98
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user