From 8249b8eb201d89551dd2aa22ff358fef22ebabc3 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Tue, 15 Nov 2016 16:38:25 +0100 Subject: [PATCH] old style PropertiesOptionError is now accepted --- tiramisu/error.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tiramisu/error.py b/tiramisu/error.py index 2ccf27f..5c86fc1 100644 --- a/tiramisu/error.py +++ b/tiramisu/error.py @@ -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():