aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorDaniel Mensinger <daniel@mensinger-ka.de>2021-07-31 17:51:05 +0200
committerXavier Claessens <xclaesse@gmail.com>2021-08-09 09:40:35 -0400
commit5c87167a34c6ed703444af180fffd8a45a7928ee (patch)
tree6eb176bb2c98c4bcdfd9b3eb1a8294707d58aed2 /mesonbuild
parentf2fe271198554ce5a3c18676d57dddf4b030e0ab (diff)
downloadmeson-5c87167a34c6ed703444af180fffd8a45a7928ee.zip
meson-5c87167a34c6ed703444af180fffd8a45a7928ee.tar.gz
meson-5c87167a34c6ed703444af180fffd8a45a7928ee.tar.bz2
interpreter: Fix list contains for Holders (fixes #9020 #9047)
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/interpreterbase/interpreterbase.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/mesonbuild/interpreterbase/interpreterbase.py b/mesonbuild/interpreterbase/interpreterbase.py
index b8a6d1a..115e24b 100644
--- a/mesonbuild/interpreterbase/interpreterbase.py
+++ b/mesonbuild/interpreterbase/interpreterbase.py
@@ -783,7 +783,7 @@ The result of this is undefined and will become a hard error in a future Meson r
posargs: T.List[TYPE_var],
kwargs: TYPE_kwargs) -> T.Union[TYPE_var, InterpreterObject]:
if method_name == 'contains':
- def check_contains(el: list) -> bool:
+ def check_contains(el: T.List[TYPE_var]) -> bool:
if len(posargs) != 1:
raise InterpreterException('Contains method takes exactly one argument.')
item = posargs[0]
@@ -795,7 +795,7 @@ The result of this is undefined and will become a hard error in a future Meson r
if element == item:
return True
return False
- return check_contains(obj)
+ return check_contains([_unholder(x) for x in obj])
elif method_name == 'length':
return len(obj)
elif method_name == 'get':