diff options
Diffstat (limited to 'mesonbuild/interpreter.py')
-rw-r--r-- | mesonbuild/interpreter.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index 63cdf9e..359dd17 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -161,6 +161,7 @@ class ConfigurationDataHolder(MutableInterpreterObject): 'set_quoted': self.set_quoted_method, 'has': self.has_method, 'get': self.get_method, + 'merge_from': self.merge_from_method, }) def is_used(self): @@ -221,6 +222,16 @@ class ConfigurationDataHolder(MutableInterpreterObject): def keys(self): return self.held_object.values.keys() + def merge_from_method(self, args, kwargs): + if len(args) != 1: + raise InterpreterException('Merge_from takes one positional argument.') + from_object = args[0] + if not isinstance(from_object, ConfigurationDataHolder): + raise InterpreterException('Merge_from argument must be a configuration data object.') + from_object = from_object.held_object + for k, v in from_object.values.items(): + self.held_object.values[k] = v + # Interpreter objects can not be pickled so we must have # these wrappers. @@ -1479,6 +1490,10 @@ class Interpreter(InterpreterBase): if len(args) != 1: raise InvalidCode('Import takes one argument.') modname = args[0] + if modname.startswith('unstable-'): + plainname = modname.split('-', 1)[1] + mlog.warning('Module %s has no backwards or forwards compatibility and might not exist in future releases.' % modname) + modname = 'unstable_' + plainname if modname not in self.environment.coredata.modules: try: module = importlib.import_module('mesonbuild.modules.' + modname) |