Skip to content

Commit 04508a3

Browse files
pre-commit-ci[bot]BobTheBuidler
authored andcommitted
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 78dc09a commit 04508a3

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

mypy/constant_fold.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -226,14 +226,14 @@ def constant_fold_call_expr(
226226
func = foldable_builtins.get(callee.fullname)
227227
if func is None:
228228
return None
229-
229+
230230
folded_args = []
231231
for arg in expr.args:
232232
val = constant_fold_expr(arg, cur_mod_id)
233233
if val is None:
234234
return None
235235
folded_args.append(arg)
236-
236+
237237
args = []
238238
kwargs = {}
239239
for folded_arg, arg_kind, arg_name in zip(folded_args, expr.arg_kinds, expr.arg_names):
@@ -254,9 +254,8 @@ def constant_fold_call_expr(
254254
except:
255255
return None
256256
# --- f-string requires partial support for both str.join and str.format ---
257-
elif (
258-
isinstance(callee, MemberExpr)
259-
and isinstance(folded_callee := constant_fold_expr(callee.expr, cur_mod_id), str)
257+
elif isinstance(callee, MemberExpr) and isinstance(
258+
folded_callee := constant_fold_expr(callee.expr, cur_mod_id), str
260259
):
261260
# --- partial str.join constant folding ---
262261
if (
@@ -279,4 +278,4 @@ def constant_fold_call_expr(
279278
if arg_val is None:
280279
return None
281280
folded_args.append(arg_val)
282-
return folded_callee.format(*folded_args)
281+
return folded_callee.format(*folded_args)

0 commit comments

Comments
 (0)