Skip to content

Commit 2665c94

Browse files
Update constant_fold.py
1 parent ed2ab02 commit 2665c94

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mypyc/irbuild/constant_fold.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def constant_fold_expr(builder: IRBuilder, expr: Expression) -> ConstantValue |
7878
isinstance(expr, CallExpr)
7979
and isinstance(callee := expr.callee, MemberExpr)
8080
and callee.name == "format"
81-
and (folded_callee := constant_fold_expr(callee)) is not None
81+
and isinstance(folded_callee := constant_fold_expr(builder, callee), str)
8282
):
8383
folded_args: list[ConstantValue] = []
8484
for arg in expr.args:

0 commit comments

Comments
 (0)