Skip to content

Commit ed2ab02

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent b8aa2e5 commit ed2ab02

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

mypyc/irbuild/constant_fold.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,12 @@ def constant_fold_expr(builder: IRBuilder, expr: Expression) -> ConstantValue |
7474
if value is not None and not isinstance(value, bytes):
7575
return constant_fold_unary_op(expr.op, value)
7676
# --- str.format constant folding
77-
elif isinstance(expr, CallExpr) and isinstance(callee := expr.callee, MemberExpr) and callee.name == "format" and (folded_callee := constant_fold_expr(callee)) is not None:
77+
elif (
78+
isinstance(expr, CallExpr)
79+
and isinstance(callee := expr.callee, MemberExpr)
80+
and callee.name == "format"
81+
and (folded_callee := constant_fold_expr(callee)) is not None
82+
):
7883
folded_args: list[ConstantValue] = []
7984
for arg in expr.args:
8085
arg_val = constant_fold_expr(builder, arg)

0 commit comments

Comments
 (0)