Skip to content

Commit

Permalink
Define error e if not defined (#499)
Browse files Browse the repository at this point in the history
  • Loading branch information
samwaseda authored Nov 22, 2024
1 parent 9e776ad commit d63dc5e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pyiron_workflow/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ def _save(
if self._fallback(cloudpickle_fallback):
attacks += [(self._CLOUDPICKLE, cloudpickle.dump)]

e = None
for suffix, save_method in attacks:
p = filename.with_suffix(suffix)
try:
Expand All @@ -232,7 +233,8 @@ def _save(
return
except Exception as e:
p.unlink(missing_ok=True)
raise e
if e is not None:
raise e

def _load(self, filename: Path, cloudpickle_fallback: bool | None = None) -> Node:
attacks = [(self._PICKLE, pickle.load)]
Expand Down

0 comments on commit d63dc5e

Please sign in to comment.