Skip to content

Commit a3b7577

Browse files
Update constant_fold.py
1 parent f449a1e commit a3b7577

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

mypy/constant_fold.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,13 +222,15 @@ def constant_fold_call_expr(
222222
cur_mod_id: str,
223223
foldable_builtins: dict[str, Callable[..., Any]] = foldable_builtins,
224224
) -> ConstantValue | None:
225+
folded_args: list[ConstantValue]
226+
225227
callee = expr.callee
226228
if isinstance(callee, NameExpr):
227229
func = foldable_builtins.get(callee.fullname)
228230
if func is None:
229231
return None
230232

231-
folded_args: list[ConstantValue] = []
233+
folded_args = []
232234
for arg in expr.args:
233235
val = constant_fold_expr(arg, cur_mod_id)
234236
if val is None:
@@ -273,7 +275,7 @@ def constant_fold_call_expr(
273275
return folded_callee.join(folded_items)
274276
# --- str.format constant folding ---
275277
elif callee.name == "format":
276-
folded_strings: list[str] = []
278+
folded_args = []
277279
for arg in expr.args:
278280
arg_val = constant_fold_expr(arg, cur_mod_id)
279281
if arg_val is None:

0 commit comments

Comments
 (0)