tell variable name when erroring on bad combo option

fixes #7269
pull/7302/head
Michael Hirsch 5 years ago committed by Jussi Pakkanen
parent 2fe4c60ae3
commit 58e1534773
  1. 4
      mesonbuild/coredata.py

@ -161,7 +161,9 @@ class UserComboOption(UserOption[str]):
def validate_value(self, value): def validate_value(self, value):
if value not in self.choices: if value not in self.choices:
optionsstring = ', '.join(['"%s"' % (item,) for item in self.choices]) optionsstring = ', '.join(['"%s"' % (item,) for item in self.choices])
raise MesonException('Value "%s" for combo option is not one of the choices. Possible choices are: %s.' % (value, optionsstring)) raise MesonException('Value "{}" for combo option "{}" is not one of the choices.'
' Possible choices are: {}.'.format(
value, self.description, optionsstring))
return value return value
class UserArrayOption(UserOption[T.List[str]]): class UserArrayOption(UserOption[T.List[str]]):

Loading…
Cancel
Save