old style PropertiesOptionError is now accepted
This commit is contained in:
parent
b49daa1b35
commit
8249b8eb20
|
@ -31,7 +31,7 @@ def display_list(lst, separator='and'):
|
|||
# Exceptions for an Option
|
||||
class PropertiesOptionError(AttributeError):
|
||||
"attempt to access to an option with a property that is not allowed"
|
||||
def __init__(self, msg, proptype, settings, datas, option_type):
|
||||
def __init__(self, msg, proptype, settings=None, datas=None, option_type=None):
|
||||
self.proptype = proptype
|
||||
self._settings = settings
|
||||
self._datas = datas
|
||||
|
@ -40,7 +40,10 @@ class PropertiesOptionError(AttributeError):
|
|||
|
||||
def __str__(self):
|
||||
#this part is a bit slow, so only execute when display
|
||||
req = self._settings.apply_requires(**self._datas)
|
||||
if self._settings is None:
|
||||
req = {}
|
||||
else:
|
||||
req = self._settings.apply_requires(**self._datas)
|
||||
if req != {}:
|
||||
msg = []
|
||||
for action, msg_ in req.items():
|
||||
|
|
Loading…
Reference in New Issue