Skip to content

Commit 850484f

Browse files
Update ops.py
1 parent d670522 commit 850484f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mypyc/ir/ops.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,11 +1049,11 @@ def __init__(self, src: Value, index: int, line: int = -1, *, borrow: bool = Fal
10491049
src.type, RTuple
10501050
), "TupleGet only operates on tuples, not {type(src.type).__name__}"
10511051
src_len = len(src.type.types)
1052-
if index < 0:
1053-
index += src_len
1054-
assert index <= src_len - 1, f"Index out of range.\nsource type: {src.type}\nindex: {index}"
10551052
self.src = src
10561053
self.index = index
1054+
if index < 0:
1055+
self.index += src_len
1056+
assert self.index <= src_len - 1, f"Index out of range.\nsource type: {src.type}\nindex: {index}"
10571057
self.type = src.type.types[index]
10581058
self.is_borrowed = borrow
10591059

0 commit comments

Comments
 (0)