Skip to content

Commit

Permalink
no walrus
Browse files Browse the repository at this point in the history
  • Loading branch information
tlambert03 committed Nov 15, 2023
1 parent 46d6263 commit 2289046
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/nd2/readers/_modern/modern_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,8 @@ def read_frame(self, index: int) -> np.ndarray:
# sometimes a frame index has a valid offset even if it's greater than
# _seq_count() (for example, if experiment parsing misses stuff)
# so, it should still be accessible.
if (offset := self._frame_offsets.get(index, None)) is None:
offset = self._frame_offsets.get(index, None)
if offset is None:
if index > self._seq_count(): # pragma: no cover
raise IndexError(f"Frame out of range: {index}")
return self._missing_frame(index)
Expand Down

0 comments on commit 2289046

Please sign in to comment.