catch malformed command line array option with helpful error

fixes #6291
pull/6312/head
Michael Hirsch, Ph.D 5 years ago committed by Xavier Claessens
parent 9cb600cbb8
commit 1031c96d31
  1. 5
      mesonbuild/coredata.py

@ -180,7 +180,10 @@ class UserArrayOption(UserOption[List[str]]):
if isinstance(value, str):
if value.startswith('['):
newvalue = ast.literal_eval(value)
try:
newvalue = ast.literal_eval(value)
except ValueError:
raise MesonException('malformed option {}'.format(value))
elif value == '':
newvalue = []
else:

Loading…
Cancel
Save