MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / ArgumentError

Class ArgumentError

tools/python-3.11.9-amd64/Lib/argparse.py:764–781  ·  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

762
763
764class ArgumentError(Exception):
765 """An error from creating or using an argument (optional or positional).
766
767 The string value of this exception is the message, augmented with
768 information about the argument that caused it.
769 """
770
771 def __init__(self, argument, message):
772 self.argument_name = _get_action_name(argument)
773 self.message = message
774
775 def __str__(self):
776 if self.argument_name is None:
777 format = '%(message)s'
778 else:
779 format = _('argument %(argument_name)s: %(message)s')
780 return format % dict(message=self.message,
781 argument_name=self.argument_name)
782
783
784class ArgumentTypeError(Exception):

Callers 8

add_parserMethod · 0.85
__call__Method · 0.85
take_actionMethod · 0.85
consume_optionalMethod · 0.85
_match_argumentMethod · 0.85
_get_valueMethod · 0.85
_check_valueMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected