aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/interpreterbase/interpreterbase.py
diff options
context:
space:
mode:
authorDaniel Mensinger <daniel@mensinger-ka.de>2021-09-01 23:46:56 +0200
committerDaniel Mensinger <daniel@mensinger-ka.de>2021-09-25 12:44:11 +0200
commit6b00c7dc810131da65029598b97abbcf3584067c (patch)
treeb5837f7f8fee220c9212e49af411e08285a8d1ae /mesonbuild/interpreterbase/interpreterbase.py
parentd93d01b6c5c98a77e057b914e8d66b01d2a10771 (diff)
downloadmeson-6b00c7dc810131da65029598b97abbcf3584067c.zip
meson-6b00c7dc810131da65029598b97abbcf3584067c.tar.gz
meson-6b00c7dc810131da65029598b97abbcf3584067c.tar.bz2
Remove helpers.check_stringlist()
Diffstat (limited to 'mesonbuild/interpreterbase/interpreterbase.py')
-rw-r--r--mesonbuild/interpreterbase/interpreterbase.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/mesonbuild/interpreterbase/interpreterbase.py b/mesonbuild/interpreterbase/interpreterbase.py
index 9ae50c8..4b4b3c0 100644
--- a/mesonbuild/interpreterbase/interpreterbase.py
+++ b/mesonbuild/interpreterbase/interpreterbase.py
@@ -44,7 +44,7 @@ from .exceptions import (
from .decorators import FeatureNew, noKwargs
from .disabler import Disabler, is_disabled
-from .helpers import check_stringlist, default_resolve_key, flatten, resolve_second_level_holders
+from .helpers import default_resolve_key, flatten, resolve_second_level_holders
from .operator import MesonOperator
from ._unholder import _unholder
@@ -579,11 +579,13 @@ class InterpreterBase:
iobject = self.evaluate_statement(node.iobject)
if isinstance(iobject, Disabler):
return iobject
+ index = _unholder(self.evaluate_statement(node.index))
+
+ if isinstance(iobject, InterpreterObject):
+ return self._holderify(iobject.operator_call(MesonOperator.INDEX, index))
if not hasattr(iobject, '__getitem__'):
raise InterpreterException(
'Tried to index an object that doesn\'t support indexing.')
- index = _unholder(self.evaluate_statement(node.index))
-
if isinstance(iobject, dict):
if not isinstance(index, str):
raise InterpreterException('Key is not a string')
@@ -887,7 +889,7 @@ To specify a keyword argument, use : instead of =.''')
raise InvalidCode('Unknown variable "%s".' % varname)
def is_assignable(self, value: T.Any) -> bool:
- return isinstance(value, (InterpreterObject, str, int, list, dict))
+ return isinstance(value, (InterpreterObject, list, dict))
def validate_extraction(self, buildtarget: mesonlib.HoldableObject) -> None:
raise InterpreterException('validate_extraction is not implemented in this context (please file a bug)')