diff options
Diffstat (limited to 'mesonbuild/interpreterbase.py')
-rw-r--r-- | mesonbuild/interpreterbase.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/mesonbuild/interpreterbase.py b/mesonbuild/interpreterbase.py index 70751c1..3e09310 100644 --- a/mesonbuild/interpreterbase.py +++ b/mesonbuild/interpreterbase.py @@ -500,6 +500,8 @@ class InterpreterBase: def evaluate_notstatement(self, cur): v = self.evaluate_statement(cur.value) + if is_disabler(v): + return v if not isinstance(v, bool): raise InterpreterException('Argument to "not" is not a boolean.') return not v @@ -680,8 +682,6 @@ The result of this is undefined and will become a hard error in a future Meson r if len(node.varnames) != 1: raise InvalidArguments('Foreach on array does not unpack') varname = node.varnames[0].value - if is_disabler(items): - return items for item in items: self.set_variable(varname, item) try: @@ -693,8 +693,6 @@ The result of this is undefined and will become a hard error in a future Meson r elif isinstance(items, dict): if len(node.varnames) != 2: raise InvalidArguments('Foreach on dict unpacks key and value') - if is_disabler(items): - return items for key, value in items.items(): self.set_variable(node.varnames[0].value, key) self.set_variable(node.varnames[1].value, value) |