aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorMathieu Duponchelle <mathieu@centricular.com>2018-05-09 15:08:52 +0200
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2018-05-09 18:00:36 +0200
commitdc91aad42009f739f9e6d73221efc071626c28a3 (patch)
tree01e1a768d0fd22fe63aabe6b3ddbbe2f5b10d0c2 /mesonbuild
parente9a181a5459ed1204b6250e16d2fdd291816c67a (diff)
downloadmeson-dc91aad42009f739f9e6d73221efc071626c28a3.zip
meson-dc91aad42009f739f9e6d73221efc071626c28a3.tar.gz
meson-dc91aad42009f739f9e6d73221efc071626c28a3.tar.bz2
args flattening: preserve configuration_data.set behaviour
It seems that some projects relied on the previously buggy behaviour of accepting a 2-element list as the single argument to configuration_data.set(). Special-case this behaviour, and emit a deprecation message.
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/interpreter.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py
index 7324f67..828ab35 100644
--- a/mesonbuild/interpreter.py
+++ b/mesonbuild/interpreter.py
@@ -211,6 +211,12 @@ class ConfigurationDataHolder(MutableInterpreterObject, ObjectHolder):
self.used = True
def validate_args(self, args, kwargs):
+ if len(args) == 1 and isinstance(args[0], list) and len(args[0]) == 2:
+ mlog.log(mlog.red('DEPRECATION:'),
+ '''Passing a list as the single argument to configuration_data.set is deprecated.
+This will become a hard error in the future''')
+ args = args[0]
+
if len(args) != 2:
raise InterpreterException("Configuration set requires 2 arguments.")
if self.used: