MCPcopy Index your code
hub / github.com/RustPython/RustPython / error

Method error

Lib/argparse.py:2769–2780  ·  view source on GitHub ↗

error(message: string) Prints a usage message incorporating the message to stderr and exits. If you override this in a subclass, it should not return -- it should either exit or raise an exception.

(self, message)

Source from the content-addressed store, hash-verified

2767 _sys.exit(status)
2768
2769 def error(self, message):
2770 """error(message: string)
2771
2772 Prints a usage message incorporating the message to stderr and
2773 exits.
2774
2775 If you override this in a subclass, it should not return -- it
2776 should either exit or raise an exception.
2777 """
2778 self.print_usage(_sys.stderr)
2779 args = {'prog': self.prog, 'message': message}
2780 self.exit(2, _('%(prog)s: error: %(message)s\n') % args)
2781
2782 def _warning(self, message):
2783 args = {'prog': self.prog, 'message': message}

Callers 9

mainFunction · 0.95
mainFunction · 0.95
mainFunction · 0.95
parse_argsMethod · 0.95
_parse_known_args2Method · 0.95
parse_intermixed_argsMethod · 0.95
mainFunction · 0.95
mainFunction · 0.95
mainFunction · 0.95

Calls 3

print_usageMethod · 0.95
exitMethod · 0.95
_Function · 0.50

Tested by

no test coverage detected