Skip to content

Commit 26f390f

Browse files
Update for_helpers.py
1 parent 8124aa2 commit 26f390f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mypyc/irbuild/for_helpers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ def make_for_loop_generator(
436436
line: int,
437437
is_async: bool = False,
438438
nested: bool = False,
439-
body_insts: GenFunc = None,
439+
body_insts: Optional[GenFunc] = None,
440440
can_unroll: bool = True,
441441
) -> ForGenerator:
442442
"""Return helper object for generating a for loop over an iterable.
@@ -456,7 +456,7 @@ def make_for_loop_generator(
456456

457457
rtyp = builder.node_type(expr)
458458

459-
if can_unroll:
459+
if can_unroll and body_insts is not None:
460460
# Special case: tuple/list/set literal (unroll the loop)
461461
if is_iterable_expr_with_literal_mambers(expr):
462462
return ForUnrolledSequenceLiteral(

0 commit comments

Comments
 (0)