Skip to content

Commit 148cc5f

Browse files
lint
1 parent 9a73bc5 commit 148cc5f

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

mypy/constant_fold.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,8 @@ def constant_fold_call_expr(
239239

240240
call_args: list[ConstantValue] = []
241241
call_kwargs: dict[str, ConstantValue] = {}
242-
for folded_arg, arg_kind, arg_name in zip(folded_args, expr.arg_kinds, expr.arg_names):
243-
try:
242+
try:
243+
for folded_arg, arg_kind, arg_name in zip(folded_args, expr.arg_kinds, expr.arg_names):
244244
if arg_kind == ArgKind.ARG_POS:
245245
call_args.append(folded_arg)
246246
elif arg_kind == ArgKind.ARG_NAMED:
@@ -249,12 +249,8 @@ def constant_fold_call_expr(
249249
call_args.extend(folded_arg) # type: ignore [arg-type]
250250
elif arg_kind == ArgKind.ARG_STAR2:
251251
call_kwargs.update(folded_arg) # type: ignore [arg-type]
252-
except:
253-
return None
254-
255-
try:
256252
return func(*call_args, **call_kwargs) # type: ignore [no-any-return]
257-
except:
253+
except Exception:
258254
return None
259255
# --- f-string requires partial support for both str.join and str.format ---
260256
elif isinstance(callee, MemberExpr) and isinstance(

0 commit comments

Comments
 (0)