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)
| 2627 | _sys.exit(status) |
| 2628 | |
| 2629 | def error(self, message): |
| 2630 | """error(message: string) |
| 2631 | |
| 2632 | Prints a usage message incorporating the message to stderr and |
| 2633 | exits. |
| 2634 | |
| 2635 | If you override this in a subclass, it should not return -- it |
| 2636 | should either exit or raise an exception. |
| 2637 | """ |
| 2638 | self.print_usage(_sys.stderr) |
| 2639 | args = {'prog': self.prog, 'message': message} |
| 2640 | self.exit(2, _('%(prog)s: error: %(message)s\n') % args) |
no test coverage detected