aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIñigo Martínez <inigomartinez@gmail.com>2017-12-18 10:23:26 +0100
committerIñigo Martínez <inigomartinez@gmail.com>2017-12-18 10:23:26 +0100
commit3a1f4ab34c8fc752a6c25cd8e494344d9c2b7b26 (patch)
treec936c1289a6f8f95a1a9329e2cb11084d08a573e
parentd232a80e90a9bd4e7c677c695a9c230ac1ec8361 (diff)
downloadmeson-3a1f4ab34c8fc752a6c25cd8e494344d9c2b7b26.zip
meson-3a1f4ab34c8fc752a6c25cd8e494344d9c2b7b26.tar.gz
meson-3a1f4ab34c8fc752a6c25cd8e494344d9c2b7b26.tar.bz2
Remove duplicated values in array options
Array options can receive duplicated values, which can produce errors if case those duplicated values make processing some elements twice when they are expected to be processed only once.
-rw-r--r--mesonbuild/coredata.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py
index cf7df5e..bc903cf 100644
--- a/mesonbuild/coredata.py
+++ b/mesonbuild/coredata.py
@@ -147,7 +147,7 @@ class UserArrayOption(UserOption):
if value.startswith('['):
newvalue = ast.literal_eval(value)
else:
- newvalue = [v.strip() for v in value.split(',')]
+ newvalue = [v.strip() for v in OrderedDict.fromkeys(value.split(','))]
if not isinstance(newvalue, list):
raise MesonException('"{0}" should be a string array, but it is not'.format(str(newvalue)))
for i in newvalue: