Skip to content

Commit

Permalink
Fix SyncClient close for not fully initialized object (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattbit authored Sep 13, 2024
1 parent 5dd9af9 commit ab418b7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/giskard_hub/_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ def delete(self, path: str, **kwargs):
return self._request("DELETE", path, **kwargs)

def close(self):
self._http.close()
try:
self._http.close()
except AttributeError:
# This may happen if the client was not properly initialized yet
pass

def __del__(self):
self.close()
Expand Down

0 comments on commit ab418b7

Please sign in to comment.