An error from creating or using an argument (optional or positional). The string value of this exception is the message, augmented with information about the argument that caused it.
| 858 | |
| 859 | |
| 860 | class ArgumentError(Exception): |
| 861 | """An error from creating or using an argument (optional or positional). |
| 862 | |
| 863 | The string value of this exception is the message, augmented with |
| 864 | information about the argument that caused it. |
| 865 | """ |
| 866 | |
| 867 | def __init__(self, argument, message): |
| 868 | self.argument_name = _get_action_name(argument) |
| 869 | self.message = message |
| 870 | |
| 871 | def __str__(self): |
| 872 | if self.argument_name is None: |
| 873 | format = '%(message)s' |
| 874 | else: |
| 875 | format = _('argument %(argument_name)s: %(message)s') |
| 876 | return format % dict(message=self.message, |
| 877 | argument_name=self.argument_name) |
| 878 | |
| 879 | |
| 880 | class ArgumentTypeError(Exception): |
no outgoing calls
no test coverage detected
searching dependent graphs…