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

Method error

Lib/optparse.py:1551–1559  ·  view source on GitHub ↗

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

(self, msg)

Source from the content-addressed store, hash-verified

1549 sys.exit(status)
1550
1551 def error(self, msg):
1552 """error(msg : string)
1553
1554 Print a usage message incorporating 'msg' to stderr and exit.
1555 If you override this in a subclass, it should not return -- it
1556 should either exit or raise an exception.
1557 """
1558 self.print_usage(sys.stderr)
1559 self.exit(2, "%s: error: %s\n" % (self.get_prog_name(), msg))
1560
1561 def get_usage(self):
1562 if self.usage:

Callers 3

parse_argsMethod · 0.95
_process_long_optMethod · 0.95
_process_short_optsMethod · 0.95

Calls 3

print_usageMethod · 0.95
exitMethod · 0.95
get_prog_nameMethod · 0.95

Tested by

no test coverage detected