removes an unnecessary else statement

This commit is contained in:
gwen 2024-07-09 10:37:35 +02:00 committed by Emmanuel Garette
parent ac8392ab43
commit 510db697e5
4 changed files with 4 additions and 5 deletions

View file

@ -83,8 +83,8 @@ class NotFoundError(Exception):
## ---- specific exceptions ----
class VariableCalculationDependencyError(Exception):
"""When an 'optional=true' attribute is set, and
the target variable doesn't exists.
"""When an attribute is set, and
the target of this attribute doesn't exists.
"""
def __init__(self, msg, errno, xmlfiles):
if xmlfiles:

View file

@ -386,9 +386,6 @@ class VariableCalculation(Calculation):
if self.optional:
msg = f'the dependent variable was not found "{self.optional}" for variable "{self.path}"'
raise VariableCalculationDependencyError(msg, 90, self.xmlfiles)
else:
msg = f'Variable not found "{self.variable}" for attribute "{self.attribute_name}" for variable "{self.path}"'
raise DictConsistencyError(msg, 88, self.xmlfiles)
if not isinstance(variable, objectspace.variable):
# FIXME remove the pfff
raise Exception("pfff it's a family")

View file

@ -1,3 +1,4 @@
---
version: 1.1
#my_variable:
# multi: true

View file

@ -1,3 +1,4 @@
---
version: 1.1
my_variable:
multi: true