Skip to content

Commit ac61fae

Browse files
committed
typing
1 parent 2092801 commit ac61fae

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/zarr/codecs/_v2.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818

1919

2020
def ensure_contiguous(arr: NDArrayLike) -> NDArrayLike:
21-
if arr.flags.c_contiguous or arr.flags.f_contiguous:
21+
flags = getattr(arr, "flags", None)
22+
if flags is not None and (flags.c_contiguous or flags.f_contiguous):
2223
return arr
2324
else:
2425
return arr.copy()

0 commit comments

Comments
 (0)