From 291761e6a4be8e7161cad35268bba810ff18f1c6 Mon Sep 17 00:00:00 2001 From: Adam Waldenberg Date: Sun, 14 Jul 2013 04:57:32 +0200 Subject: [PATCH] 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. --- gitinspector/format.py | 9 +++------ gitinspector/optval.py | 9 +++------ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/gitinspector/format.py b/gitinspector/format.py index cec0d87..e5305c5 100644 --- a/gitinspector/format.py +++ b/gitinspector/format.py @@ -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__ diff --git a/gitinspector/optval.py b/gitinspector/optval.py index 6f375cc..76e11b8 100644 --- a/gitinspector/optval.py +++ b/gitinspector/optval.py @@ -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: