gh-134970: Fix exception message in argparse module (GH-134971)
Fix the "unknown action" exception in argparse.ArgumentParser.add_argument_group() to correctly replace the action class.
This commit is contained in:
parent
cebae977a6
commit
965c480566
@ -1534,7 +1534,7 @@ class _ActionsContainer(object):
|
||||
action_name = kwargs.get('action')
|
||||
action_class = self._pop_action_class(kwargs)
|
||||
if not callable(action_class):
|
||||
raise ValueError('unknown action {action_class!r}')
|
||||
raise ValueError(f'unknown action {action_class!r}')
|
||||
action = action_class(**kwargs)
|
||||
|
||||
# raise an error if action for positional argument does not
|
||||
|
@ -0,0 +1,3 @@
|
||||
Fix the "unknown action" exception in
|
||||
:meth:`argparse.ArgumentParser.add_argument_group` to correctly replace the
|
||||
action class.
|
Loading…
x
Reference in New Issue
Block a user