From 3adf6c68697d9c282ea32d7737bc36a65efdcac9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Th=C3=B6lke?= Date: Mon, 10 Feb 2025 11:47:17 +0000 Subject: [PATCH] Avoid AttributeErrors during shutdown --- src/goofi/connection.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/goofi/connection.py b/src/goofi/connection.py index 678bda3..2b94d2d 100644 --- a/src/goofi/connection.py +++ b/src/goofi/connection.py @@ -162,8 +162,11 @@ def close(self) -> None: def __del__(self) -> None: """Destructor to close the connection and free any resources associated with it.""" - self.close() - self.conn._handle = None + try: + self.close() + self.conn._handle = None + except Exception: + pass class ZeroMQConnection(Connection, ABC):