From 0e5d7ee9fb59b340f704df54a0779d4de8ce4eb6 Mon Sep 17 00:00:00 2001 From: atse Date: Tue, 9 Jan 2024 12:20:58 +0800 Subject: [PATCH] asyncio.TimeoutError not needed --- pytec/tec_qt.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pytec/tec_qt.py b/pytec/tec_qt.py index d5df38b..ddcacdb 100644 --- a/pytec/tec_qt.py +++ b/pytec/tec_qt.py @@ -78,7 +78,7 @@ class WrappedClient(QObject, Client): async def _read_line(self): try: return await super()._read_line() - except (OSError, TimeoutError, asyncio.TimeoutError) as e: # TODO: Remove asyncio.TimeoutError in Python 3.11 + except (OSError, TimeoutError) as e: logging.error("Client connection error, disconnecting", exc_info=True) self.connection_error.emit() @@ -687,7 +687,7 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow): else: await self.bail() - except (OSError, TimeoutError, asyncio.TimeoutError) as e: # TODO: Remove asyncio.TimeoutError in Python 3.11 + except (OSError, TimeoutError) as e: logging.error(f"Failed communicating to {host}:{port}: {e}") await self.bail()