diff options
author | Jonathon Reinhart <JonathonReinhart@users.noreply.github.com> | 2022-09-05 21:32:23 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-05 21:32:23 (GMT) |
commit | 30878a7735f7d5cf2023f5b2758feee850b60700 (patch) | |
tree | 75ea0332a9fb8bb48cde52a433eb168ee93fb9a0 /Lib/argparse.py | |
parent | c4999f261fb0cb28ef713b48ef2e81ca5a3eb1e1 (diff) | |
download | cpython-30878a7735f7d5cf2023f5b2758feee850b60700.zip cpython-30878a7735f7d5cf2023f5b2758feee850b60700.tar.gz cpython-30878a7735f7d5cf2023f5b2758feee850b60700.tar.bz2 |
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
Diffstat (limited to 'Lib/argparse.py')
-rw-r--r-- | Lib/argparse.py | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/Lib/argparse.py b/Lib/argparse.py index fe48f86..d2dcfdf 100644 --- a/Lib/argparse.py +++ b/Lib/argparse.py @@ -2523,7 +2523,6 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer): # ArgumentTypeErrors indicate errors except ArgumentTypeError as err: - name = getattr(action.type, '__name__', repr(action.type)) msg = str(err) raise ArgumentError(action, msg) |