Skip to content

Commit 8784efa

Browse files
Update constant_fold.py
1 parent 98ed412 commit 8784efa

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

mypyc/irbuild/constant_fold.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,19 +90,19 @@ def constant_fold_expr(builder: IRBuilder, expr: Expression) -> ConstantValue |
9090
begin_index = None
9191
else:
9292
begin_index = constant_fold_expr(builder, index_expr.begin_index)
93-
if begin_index is None:
93+
if not isinstance(begin_index, int):
9494
return None
9595
if index_expr.end_index is None:
9696
end_index = None
9797
else:
9898
end_index = constant_fold_expr(builder, index_expr.end_index)
99-
if end_index is None:
99+
if not isinstance(end_index, int):
100100
return None
101101
if index_expr.stride is None:
102102
stride = None
103103
else:
104104
stride = constant_fold_expr(builder, index_expr.stride)
105-
if stride is None:
105+
if not isinstance(stride, int):
106106
return None
107107
try:
108108
return base[begin_index:end_index:stride]

0 commit comments

Comments
 (0)