MCPcopy Index your code
hub / github.com/python/cpython / ArgumentError

Class ArgumentError

Lib/argparse.py:860–877  ·  view source on GitHub ↗

An error from creating or using an argument (optional or positional). The string value of this exception is the message, augmented with information about the argument that caused it.

Source from the content-addressed store, hash-verified

858
859
860class ArgumentError(Exception):
861 """An error from creating or using an argument (optional or positional).
862
863 The string value of this exception is the message, augmented with
864 information about the argument that caused it.
865 """
866
867 def __init__(self, argument, message):
868 self.argument_name = _get_action_name(argument)
869 self.message = message
870
871 def __str__(self):
872 if self.argument_name is None:
873 format = '%(message)s'
874 else:
875 format = _('argument %(argument_name)s: %(message)s')
876 return format % dict(message=self.message,
877 argument_name=self.argument_name)
878
879
880class ArgumentTypeError(Exception):

Callers 12

__call__Method · 0.70
parse_argsMethod · 0.70
take_actionMethod · 0.70
consume_optionalMethod · 0.70
_parse_known_argsMethod · 0.70
_read_args_from_filesMethod · 0.70
_match_argumentMethod · 0.70
_get_option_tuplesMethod · 0.70
parse_intermixed_argsMethod · 0.70
_get_valueMethod · 0.70
_check_valueMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…