Skip to content

Commit 1f894a9

Browse files
Update checkexpr.py
1 parent a642928 commit 1f894a9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mypy/checkexpr.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from mypy.checker_shared import ExpressionCheckerSharedApi
1919
from mypy.checkmember import analyze_member_access, has_operator
2020
from mypy.checkstrformat import StringFormatterChecker
21+
from mypy.constant_fold import constant_fold_expr
2122
from mypy.erasetype import erase_type, remove_instance_last_known_values, replace_meta_vars
2223
from mypy.errors import ErrorInfo, ErrorWatcher, report_internal_error
2324
from mypy.expandtype import (
@@ -659,7 +660,7 @@ def check_str_format_call(self, e: CallExpr) -> None:
659660
"""More precise type checking for str.format() calls on literals."""
660661
assert isinstance(e.callee, MemberExpr)
661662
format_value = None
662-
folded_callee_expr = constant_fold_expr(e.callee.expr, "unused")
663+
folded_callee_expr = constant_fold_expr(e.callee.expr, "<unused>")
663664
if isinstance(folded_callee_expr, str):
664665
format_value = folded_callee_expr
665666
elif self.chk.has_type(e.callee.expr):

0 commit comments

Comments
 (0)