diff options
author | Mathieu Duponchelle <mathieu@centricular.com> | 2018-04-27 00:33:20 +0200 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2018-05-04 15:24:21 +0000 |
commit | f1c92d7c9cafd13877f34746d2cb7d1f79d853dd (patch) | |
tree | 951b2a03dfae8b293a6fd04c0a11568e495092df /mesonbuild/modules | |
parent | 8b9fe0efffae288e83b60fb722a3ec25f96a335a (diff) | |
download | meson-f1c92d7c9cafd13877f34746d2cb7d1f79d853dd.zip meson-f1c92d7c9cafd13877f34746d2cb7d1f79d853dd.tar.gz meson-f1c92d7c9cafd13877f34746d2cb7d1f79d853dd.tar.bz2 |
Interpreter: don't flatten the arguments of various methods
this fixes eg set_variable('foo', ['bar', 'baz']), which
was previously erroring out complaining about the number
of arguments.
Closes #1481
Diffstat (limited to 'mesonbuild/modules')
-rw-r--r-- | mesonbuild/modules/python.py | 4 | ||||
-rw-r--r-- | mesonbuild/modules/unstable_icestorm.py | 3 |
2 files changed, 6 insertions, 1 deletions
diff --git a/mesonbuild/modules/python.py b/mesonbuild/modules/python.py index 0e569a0..a705109 100644 --- a/mesonbuild/modules/python.py +++ b/mesonbuild/modules/python.py @@ -25,6 +25,7 @@ from ..interpreterbase import ( InterpreterObject, InvalidArguments ) from ..interpreter import ExternalProgramHolder +from ..interpreterbase import flatten from ..build import known_shmod_kwargs from .. import mlog from ..environment import detect_cpu_family @@ -415,6 +416,9 @@ class PythonInstallation(ExternalProgramHolder, InterpreterObject): except AttributeError: raise InvalidArguments('Python object does not have method %s.' % method_name) + if not getattr(fn, 'no-args-flattening', False): + args = flatten(args) + if method_name in ['extension_module', 'dependency', 'install_sources']: value = fn(self.interpreter, None, args, kwargs) return self.interpreter.holderify(value) diff --git a/mesonbuild/modules/unstable_icestorm.py b/mesonbuild/modules/unstable_icestorm.py index 55c647f..bf06314 100644 --- a/mesonbuild/modules/unstable_icestorm.py +++ b/mesonbuild/modules/unstable_icestorm.py @@ -13,6 +13,7 @@ # limitations under the License. from .. import mesonlib +from ..interpreterbase import flatten from . import ExtensionModule @@ -42,7 +43,7 @@ class IceStormModule(ExtensionModule): kwarg_sources = kwargs.get('sources', []) if not isinstance(kwarg_sources, list): kwarg_sources = [kwarg_sources] - all_sources = interpreter.source_strings_to_files(interpreter.flatten(arg_sources + kwarg_sources)) + all_sources = interpreter.source_strings_to_files(flatten(arg_sources + kwarg_sources)) if 'constraint_file' not in kwargs: raise mesonlib.MesonException('Constraint file not specified.') |