From 3a1f4ab34c8fc752a6c25cd8e494344d9c2b7b26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=C3=B1igo=20Mart=C3=ADnez?= Date: Mon, 18 Dec 2017 10:23:26 +0100 Subject: [PATCH] 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. --- mesonbuild/coredata.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: