Skip to content

Commit 66c40bd

Browse files
Update constant_fold.py
1 parent 0d0ae5d commit 66c40bd

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

mypyc/irbuild/constant_fold.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,9 @@ def constant_fold_expr(builder: IRBuilder, expr: Expression) -> ConstantValue |
107107

108108
# this branching just keeps mypy happy, non-functional
109109
if isinstance(base, Sequence):
110-
indexes = begin_index, end_index, stride
111-
assert all(isinstance(v, int) or v is None for v in indexes)
110+
assert isinstance(begin_index, int) or begin_index is None
111+
assert isinstance(end_index, int) or end_index is None
112+
assert isinstance(stride, int) or stride is None
112113
try:
113114
return base[begin_index:end_index:stride]
114115
except Exception:

0 commit comments

Comments
 (0)