Skip to content

Commit

Permalink
Catch Keyerror when pointing to non existing group
Browse files Browse the repository at this point in the history
If the HDF5 file exists, but Pointer is indexed to a not (yet) existing group, to_dict()/repr throw
errors because the code only checks for FileNotFoundError.
  • Loading branch information
pmrv committed Jan 3, 2024
1 parent 51d082f commit a906e26
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion h5io_browser/pointer.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ def to_dict(self, hierarchical=False):
h5_path=self._h5_path,
recursive=True,
)
except FileNotFoundError:
except (FileNotFoundError, KeyError):
return {}
else:
if self._h5_path == "/":
Expand Down

0 comments on commit a906e26

Please sign in to comment.