Skip to content

Commit

Permalink
Avoid AttributeErrors during shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippThoelke committed Feb 10, 2025
1 parent 326deb1 commit 3adf6c6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/goofi/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 3adf6c6

Please sign in to comment.