diff options
author | Iñigo MartÃnez <inigomartinez@gmail.com> | 2017-12-18 10:23:26 +0100 |
---|---|---|
committer | Iñigo MartÃnez <inigomartinez@gmail.com> | 2017-12-18 10:23:26 +0100 |
commit | 3a1f4ab34c8fc752a6c25cd8e494344d9c2b7b26 (patch) | |
tree | c936c1289a6f8f95a1a9329e2cb11084d08a573e | |
parent | d232a80e90a9bd4e7c677c695a9c230ac1ec8361 (diff) | |
download | meson-3a1f4ab34c8fc752a6c25cd8e494344d9c2b7b26.tar.gz |
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.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py index cf7df5ee4..bc903cf9a 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: |