aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/interpreterbase/interpreterbase.py
diff options
context:
space:
mode:
authorDaniel Mensinger <daniel@mensinger-ka.de>2021-06-28 17:22:14 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2021-07-02 17:14:44 +0300
commit971a0b1775ef80fc0877b3b90f75803f197c866b (patch)
tree40f206fa6112707dfc0600546c072e104a55c5e1 /mesonbuild/interpreterbase/interpreterbase.py
parent5bb93490c4c15198bcd230ecf64d3e5c5ef17951 (diff)
downloadmeson-971a0b1775ef80fc0877b3b90f75803f197c866b.zip
meson-971a0b1775ef80fc0877b3b90f75803f197c866b.tar.gz
meson-971a0b1775ef80fc0877b3b90f75803f197c866b.tar.bz2
fix: get_variable default variables are not ObjectHolders (fixes #8936)
Diffstat (limited to 'mesonbuild/interpreterbase/interpreterbase.py')
-rw-r--r--mesonbuild/interpreterbase/interpreterbase.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/mesonbuild/interpreterbase/interpreterbase.py b/mesonbuild/interpreterbase/interpreterbase.py
index d66fb9c..91cb7aa 100644
--- a/mesonbuild/interpreterbase/interpreterbase.py
+++ b/mesonbuild/interpreterbase/interpreterbase.py
@@ -268,7 +268,7 @@ class InterpreterBase:
return True
def evaluate_in(self, val1: T.Any, val2: T.Any) -> bool:
- if not isinstance(val1, (str, int, float, ObjectHolder)):
+ if not isinstance(val1, (str, int, float, mesonlib.HoldableObject)):
raise InvalidArguments('lvalue of "in" operator must be a string, integer, float, or object')
if not isinstance(val2, (list, dict)):
raise InvalidArguments('rvalue of "in" operator must be an array or a dict')
@@ -281,6 +281,9 @@ class InterpreterBase:
val2 = self.evaluate_statement(node.right)
if isinstance(val2, Disabler):
return val2
+ # Do not compare the ObjectHolders but the actual held objects
+ val1 = _unholder(val1)
+ val2 = _unholder(val2)
if node.ctype == 'in':
return self.evaluate_in(val1, val2)
elif node.ctype == 'notin':