mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Fix ScriptError to always return string from __str__
Use super for proper handling of exceptions. msg property was added due compatibility with the current code. https://fedorahosted.org/freeipa/ticket/6294 Reviewed-By: Tomas Krizek <tkrizek@redhat.com>
This commit is contained in:
@@ -38,11 +38,12 @@ class ScriptError(Exception):
|
||||
def __init__(self, msg='', rval=1):
|
||||
if msg is None:
|
||||
msg = ''
|
||||
self.msg = msg
|
||||
super(ScriptError, self).__init__(msg)
|
||||
self.rval = rval
|
||||
|
||||
def __str__(self):
|
||||
return self.msg
|
||||
@property
|
||||
def msg(self):
|
||||
return str(self)
|
||||
|
||||
|
||||
class AdminTool(object):
|
||||
|
||||
Reference in New Issue
Block a user