Skip to content

Commit 903c1cd

Browse files
committed
fix(builtins.slice): toNimSlice's assert not work
1 parent cd9ed64 commit 903c1cd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/pylib/builtins/pyslice.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ converter toPySlice*(s: PySlice1): PySlice =
3232
result = PySlice(start: s.start, stop: s.stop, step: 1)
3333

3434
proc toNimSlice*(s: PySlice1): Slice[int] =
35-
assert result.a >= 0 and result.b >= 0
3635
result.b = s.stop - 1
3736
result.a = s.start
37+
assert result.a >= 0 and result.b >= 0
3838

3939
func repr*(self: PySlice): string =
4040
result = "slice(" & $self.start & ", "

0 commit comments

Comments
 (0)