remove all try/except

This commit is contained in:
2016-01-03 21:18:52 +01:00
parent e8764f6173
commit b521c459ee
9 changed files with 236 additions and 180 deletions

View File

@ -622,28 +622,30 @@ class Settings(object):
"imbrication detected for option:"
" '{0}' with requirement on: "
"'{1}'").format(path, reqpath))
try:
if option.impl_is_multi():
idx = index
if option.impl_is_multi():
idx = index
else:
idx = None
value = context.getattr(reqpath, force_permissive=True,
_setting_properties=setting_properties,
index=idx, returns_raise=True)
if isinstance(value, Exception):
if isinstance(value, PropertiesOptionError):
if not transitive:
continue
properties = value.proptype
if same_action and action not in properties: # pragma: optional cover
raise RequirementError(_("option '{0}' has "
"requirement's property "
"error: "
"{1} {2}").format(opt._name,
reqpath,
properties))
# transitive action, force expected
value = expected[0]
inverse = False
else:
idx = None
value = context.getattr(reqpath, force_permissive=True,
_setting_properties=setting_properties,
index=idx)
except PropertiesOptionError as err:
if not transitive:
continue
properties = err.proptype
if same_action and action not in properties: # pragma: optional cover
raise RequirementError(_("option '{0}' has "
"requirement's property "
"error: "
"{1} {2}").format(opt._name,
reqpath,
properties))
# transitive action, force expected
value = expected[0]
inverse = False
raise value
if (not inverse and
value in expected or
inverse and value not in expected):