forked from M-Labs/thermostat
Remove wait_for
OSError raised anyways
This commit is contained in:
parent
16f3e81384
commit
fcadb8aa44
@ -251,13 +251,11 @@ class MainWindow(QtWidgets.QMainWindow):
|
|||||||
port = self.conn_menu.port_set_spin.value()
|
port = self.conn_menu.port_set_spin.value()
|
||||||
|
|
||||||
self._connecting_task = asyncio.create_task(
|
self._connecting_task = asyncio.create_task(
|
||||||
asyncio.wait_for(
|
self.thermostat.start_session(host=host, port=port)
|
||||||
self.thermostat.start_session(host=host, port=port), timeout=5
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
await self._connecting_task
|
await self._connecting_task
|
||||||
except (OSError, asyncio.TimeoutError, asyncio.CancelledError) as exc:
|
except (OSError, asyncio.CancelledError) as exc:
|
||||||
await self.bail()
|
await self.bail()
|
||||||
if isinstance(exc, asyncio.CancelledError):
|
if isinstance(exc, asyncio.CancelledError):
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user