Skip to content

Commit 608f390

Browse files
committed
Update utility function
1 parent 125a729 commit 608f390

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/zarr/storage/_utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ def _normalize_byte_range_index(data: Buffer, byte_range: ByteRangeRequest) -> t
5555
elif isinstance(byte_range, tuple):
5656
start = byte_range[0]
5757
length = byte_range[1] - start
58-
elif start := byte_range.get("offset"):
59-
length = len(data) - start
60-
elif suffix := byte_range.get("suffix"):
61-
start = len(data) - suffix
58+
elif "offset" in byte_range:
59+
length = len(data) - byte_range["offset"]
60+
elif "suffix" in byte_range:
61+
start = len(data) - byte_range["suffix"]
6262
length = len(data) - start
6363
return (start, length)

0 commit comments

Comments
 (0)