Skip to content

Commit 30878a7

Browse files
argparse: Remove unused name variable when handling ArgumentTypeError (#96549)
This removes the unused `name` variable in the block where `ArgumentTypeError` is handled. `ArgumentTypeError` errors are handled by showing just the string of the exception; unlike `ValueError`, the name (`__name__`) of the function is not included in the error message. Fixes #96548
1 parent c4999f2 commit 30878a7

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

Lib/argparse.py

-1
Original file line numberDiff line numberDiff line change
@@ -2523,7 +2523,6 @@ def _get_value(self, action, arg_string):
25232523

25242524
# ArgumentTypeErrors indicate errors
25252525
except ArgumentTypeError as err:
2526-
name = getattr(action.type, '__name__', repr(action.type))
25272526
msg = str(err)
25282527
raise ArgumentError(action, msg)
25292528

0 commit comments

Comments
 (0)