Skip to content

Commit 3adf6c6

Browse files
committed
Avoid AttributeErrors during shutdown
1 parent 326deb1 commit 3adf6c6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/goofi/connection.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,11 @@ def close(self) -> None:
162162

163163
def __del__(self) -> None:
164164
"""Destructor to close the connection and free any resources associated with it."""
165-
self.close()
166-
self.conn._handle = None
165+
try:
166+
self.close()
167+
self.conn._handle = None
168+
except Exception:
169+
pass
167170

168171

169172
class ZeroMQConnection(Connection, ABC):

0 commit comments

Comments
 (0)