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 ---- ## ---- specific exceptions ----
class VariableCalculationDependencyError(Exception): class VariableCalculationDependencyError(Exception):
"""When an 'optional=true' attribute is set, and """When an attribute is set, and
the target variable doesn't exists. the target of this attribute doesn't exists.
""" """
def __init__(self, msg, errno, xmlfiles): def __init__(self, msg, errno, xmlfiles):
if xmlfiles: if xmlfiles:

View file

@ -386,9 +386,6 @@ class VariableCalculation(Calculation):
if self.optional: if self.optional:
msg = f'the dependent variable was not found "{self.optional}" for variable "{self.path}"' msg = f'the dependent variable was not found "{self.optional}" for variable "{self.path}"'
raise VariableCalculationDependencyError(msg, 90, self.xmlfiles) 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): if not isinstance(variable, objectspace.variable):
# FIXME remove the pfff # FIXME remove the pfff
raise Exception("pfff it's a family") raise Exception("pfff it's a family")

View file

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

View file

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