Exceptions now store messages in self.msg directly.

Previously, they had a msg() method for fetching the error string. This
has now been removed in favor of the directly callable attribute.
This commit is contained in:
Adam Waldenberg 2013-07-14 04:57:32 +02:00
parent cf63af8819
commit 291761e6a4
2 changed files with 6 additions and 12 deletions

View file

@ -32,12 +32,9 @@ DEFAULT_FORMAT = __available_formats__[2]
__selected_format__ = DEFAULT_FORMAT
class InvalidFormatError(Exception):
def __init__(self, message):
super(InvalidFormatError, self).__init__(message)
self.message = message
def msg(self):
return self.message
def __init__(self, msg):
super(InvalidFormatError, self).__init__(msg)
self.msg = msg
def select(format):
global __selected_format__

View file

@ -20,12 +20,9 @@ from __future__ import unicode_literals
import getopt
class InvalidOptionArgument(Exception):
def __init__(self, message):
super(InvalidOptionArgument, self).__init__(message)
self.message = message
def msg(self):
return self.message
def __init__(self, msg):
super(InvalidOptionArgument, self).__init__(msg)
self.msg = msg
def __find_arg_in_options__(arg, options):
for opt in options: