diff --git a/pytec/pytec/gui/model/thermostat.py b/pytec/pytec/gui/model/thermostat.py index f6e0119..7b9ef2c 100644 --- a/pytec/pytec/gui/model/thermostat.py +++ b/pytec/pytec/gui/model/thermostat.py @@ -12,7 +12,10 @@ class WrappedClient(QObject, Client): async def _read_line(self): try: return await super()._read_line() - except (Exception, TimeoutError, asyncio.exceptions.TimeoutError): + except ( + TimeoutError, + asyncio.TimeoutError, # Remove in Python 3.11 + ): self.connection_error.emit() @@ -43,9 +46,8 @@ class Thermostat(QObject, metaclass=PropertyMeta): try: raise self.task.exception() except ( - Exception, TimeoutError, - asyncio.exceptions.TimeoutError, + asyncio.TimeoutError, # Remove in Python 3.11 ): logging.error( "Encountered an error while updating parameter tree.",