mirror of
https://github.com/python/cpython.git
synced 2025-09-17 22:20:23 +00:00
Issue #9347: Fix formatting for tuples in argparse type= error messages.
This commit is contained in:
parent
824504dd7e
commit
e3c11b44e3
3 changed files with 6 additions and 2 deletions
|
@ -1277,13 +1277,13 @@ class _ActionsContainer(object):
|
|||
# create the action object, and add it to the parser
|
||||
action_class = self._pop_action_class(kwargs)
|
||||
if not _callable(action_class):
|
||||
raise ValueError('unknown action "%s"' % action_class)
|
||||
raise ValueError('unknown action "%s"' % (action_class,))
|
||||
action = action_class(**kwargs)
|
||||
|
||||
# raise an error if the action type is not callable
|
||||
type_func = self._registry_get('type', action.type, action.type)
|
||||
if not _callable(type_func):
|
||||
raise ValueError('%r is not callable' % type_func)
|
||||
raise ValueError('%r is not callable' % (type_func,))
|
||||
|
||||
# raise an error if the metavar does not match the type
|
||||
if hasattr(self, "_get_formatter"):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue