Use Exception class instead of StandardError

In except clause, use of "," is not recommended (PEP 3110)

Signed-off-by: Niranjan Mallapadi <mrniranjan@fedoraproject.org>
Reviewed-By: Martin Basti <mbasti@redhat.com>
Reviewed-By: Petr Viktorin <pviktori@redhat.com>
This commit is contained in:
Niranjan Mallapadi 2015-06-10 04:19:46 +05:30 committed by Martin Basti
parent 3c974c157f
commit 7d28230405

View File

@ -32,7 +32,7 @@ from ipapython import config
from ipapython import ipa_log_manager
class ScriptError(StandardError):
class ScriptError(Exception):
"""An exception that records an error message and a return value
"""
def __init__(self, msg='', rval=1):
@ -169,7 +169,7 @@ class AdminTool(object):
self.ask_for_options()
self.setup_logging()
return_value = self.run()
except BaseException, exception:
except BaseException as exception:
traceback = sys.exc_info()[2]
error_message, return_value = self.handle_error(exception)
if return_value: