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)
| 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: |
no test coverage detected