aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2021-05-12 16:16:41 -0400
committerJussi Pakkanen <jpakkane@gmail.com>2021-05-13 10:38:17 +0300
commit501d7cf01c5578e98ab753fd09f6972f57824e50 (patch)
tree4e191f8bf0e74fab734bea1daddca8b958bb265c /mesonbuild
parent4e312c19e693a69b0650ce6c8a8903163c959996 (diff)
downloadmeson-501d7cf01c5578e98ab753fd09f6972f57824e50.zip
meson-501d7cf01c5578e98ab753fd09f6972f57824e50.tar.gz
meson-501d7cf01c5578e98ab753fd09f6972f57824e50.tar.bz2
interpreter: flatten environment() initial values
Turns out listify() flattens by default, but stringlistify() cannot flatten... How do I realize this only now? Fixes: #8727
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/interpreter/interpreterobjects.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/mesonbuild/interpreter/interpreterobjects.py b/mesonbuild/interpreter/interpreterobjects.py
index 7d43752..10e681a 100644
--- a/mesonbuild/interpreter/interpreterobjects.py
+++ b/mesonbuild/interpreter/interpreterobjects.py
@@ -165,7 +165,9 @@ class EnvironmentVariablesHolder(MutableInterpreterObject, ObjectHolder[build.En
for k, v in initial_values.items():
self.set_method([k, v], {})
elif initial_values is not None:
- for e in mesonlib.stringlistify(initial_values):
+ for e in mesonlib.listify(initial_values):
+ if not isinstance(e, str):
+ raise InterpreterException('Env var definition must be a list of strings.')
if '=' not in e:
raise InterpreterException('Env var definition must be of type key=val.')
(k, val) = e.split('=', 1)