fix crash during MesonException

In commit e5a6283c4c, this function was
reorganized to assign value -> newvalue instead of overwriting newvalue,
but the error message case wasn't updated to match. As a result,
actually hitting the error would report an even more errory error, i.e.
a traceback.

(Actually hitting the error requires passing an array option as a python
object that isn't a list or a string. This is impossible to do from the
command line or meson_options.txt, but can be done with builtin options.)
pull/9757/head
Eli Schwartz 3 years ago
parent 1708148f51
commit db528e3bb9
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
  1. 2
      mesonbuild/coredata.py

@ -234,7 +234,7 @@ class UserArrayOption(UserOption[T.List[str]]):
elif isinstance(value, list):
newvalue = value
else:
raise MesonException(f'"{newvalue}" should be a string array, but it is not')
raise MesonException(f'"{value}" should be a string array, but it is not')
return newvalue
def validate_value(self, value: T.Union[str, T.List[str]], user_input: bool = True) -> T.List[str]:

Loading…
Cancel
Save