Skip to content

Commit

Permalink
Merge pull request #4209 from silx-kit/fix_is_h5py_exception
Browse files Browse the repository at this point in the history
h5py_utils: Fixed base exceptions cannot be h5py exceptions
  • Loading branch information
t20100 authored Jan 29, 2025
2 parents e7b05b7 + 953fd5c commit f15382c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/silx/io/h5py_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ def is_h5py_exception(e):
:param BaseException e:
:returns bool:
"""
if not isinstance(e, Exception):
return False
for frame in traceback.walk_tb(e.__traceback__):
for namespace in (frame[0].f_locals, frame[0].f_globals):
if namespace.get("__package__", None) == "h5py":
Expand Down

0 comments on commit f15382c

Please sign in to comment.