From db528e3bb9c986a28abf38ca5d28e32506d388e9 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Thu, 16 Dec 2021 17:47:43 -0500 Subject: [PATCH] fix crash during MesonException In commit e5a6283c4cf288fdfc9b43a92bf0ddd74dbf90f8, 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.) --- mesonbuild/coredata.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py index f444cf197..6ac21511e 100644 --- a/mesonbuild/coredata.py +++ b/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]: