diff options
author | Daniel Mensinger <daniel@mensinger-ka.de> | 2021-06-17 00:07:04 +0200 |
---|---|---|
committer | Daniel Mensinger <daniel@mensinger-ka.de> | 2021-06-18 23:48:33 +0200 |
commit | c2c7f7c9d7b05dddb1cee028b1b685c7f2bd424c (patch) | |
tree | 7392e6220ddede2781662bcf0851080b4f0aa1ff /mesonbuild/interpreterbase/helpers.py | |
parent | 6879e84c48632bcd0f6c277e81b4032a00bb1d5c (diff) | |
download | meson-c2c7f7c9d7b05dddb1cee028b1b685c7f2bd424c.zip meson-c2c7f7c9d7b05dddb1cee028b1b685c7f2bd424c.tar.gz meson-c2c7f7c9d7b05dddb1cee028b1b685c7f2bd424c.tar.bz2 |
holders: Ensure that InterpreterBase is the sole instance for (un)holderifying
Diffstat (limited to 'mesonbuild/interpreterbase/helpers.py')
-rw-r--r-- | mesonbuild/interpreterbase/helpers.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/mesonbuild/interpreterbase/helpers.py b/mesonbuild/interpreterbase/helpers.py index 1070a9e..2602e80 100644 --- a/mesonbuild/interpreterbase/helpers.py +++ b/mesonbuild/interpreterbase/helpers.py @@ -19,15 +19,15 @@ import collections.abc import typing as T if T.TYPE_CHECKING: - from .baseobjects import TYPE_nvar, TV_fw_args, TV_fw_kwargs + from .baseobjects import TYPE_var, TYPE_kwargs -def flatten(args: T.Union['TYPE_nvar', T.List['TYPE_nvar']]) -> T.List['TYPE_nvar']: +def flatten(args: T.Union['TYPE_var', T.List['TYPE_var']]) -> T.List['TYPE_var']: if isinstance(args, mparser.StringNode): assert isinstance(args.value, str) return [args.value] if not isinstance(args, collections.abc.Sequence): return [args] - result: T.List['TYPE_nvar'] = [] + result: T.List['TYPE_var'] = [] for a in args: if isinstance(a, list): rest = flatten(a) @@ -51,7 +51,7 @@ def default_resolve_key(key: mparser.BaseNode) -> str: raise InterpreterException('Invalid kwargs format.') return key.value -def get_callee_args(wrapped_args: T.Sequence[T.Any], want_subproject: bool = False) -> T.Tuple[T.Any, mparser.BaseNode, 'TV_fw_args', 'TV_fw_kwargs', T.Optional[str]]: +def get_callee_args(wrapped_args: T.Sequence[T.Any], want_subproject: bool = False) -> T.Tuple[T.Any, mparser.BaseNode, T.List['TYPE_var'], 'TYPE_kwargs', T.Optional[str]]: s = wrapped_args[0] n = len(wrapped_args) # Raise an error if the codepaths are not there |