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.
pull/2799/head
Iñigo Martínez 7 years ago
parent d232a80e90
commit 3a1f4ab34c
  1. 2
      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:

Loading…
Cancel
Save