Skip to content

Commit c2d517d

Browse files
Apply ruff/flake8-bugbear rule B904
B904 Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling
1 parent 8d6de3a commit c2d517d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

numcodecs/zarr3.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040

4141
if zarr.__version__ < "3.0.0": # pragma: no cover
4242
raise ImportError("zarr 3.0.0 or later is required to use the numcodecs zarr integration.")
43-
except ImportError: # pragma: no cover
44-
raise ImportError("zarr 3.0.0 or later is required to use the numcodecs zarr integration.")
43+
except ImportError as e: # pragma: no cover
44+
raise ImportError("zarr 3.0.0 or later is required to use the numcodecs zarr integration.") from e
4545

4646
from zarr.abc.codec import ArrayArrayCodec, ArrayBytesCodec, BytesBytesCodec
4747
from zarr.abc.metadata import Metadata

0 commit comments

Comments
 (0)