removes an unnecessary else statement
This commit is contained in:
parent
28e0c2fd55
commit
e9896b8a2b
4 changed files with 4 additions and 5 deletions
|
@ -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:
|
||||||
|
|
|
@ -351,9 +351,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")
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
---
|
||||||
version: 1.1
|
version: 1.1
|
||||||
#my_variable:
|
#my_variable:
|
||||||
# multi: true
|
# multi: true
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
---
|
||||||
version: 1.1
|
version: 1.1
|
||||||
my_variable:
|
my_variable:
|
||||||
multi: true
|
multi: true
|
||||||
|
|
Loading…
Reference in a new issue