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