From a0d28e850e3f112d7161b367261295796dc04858 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Sat, 27 Nov 2021 22:44:36 -0500 Subject: properly error out when project version is an array other than files() Due to the support for specifying version as files('VERSION'), we need to internally accept an array, since that is what files() returns. Before that, we didn't accept arrays, and after that, we don't intend to accept generic arrays, only arrays as a side effect of files(). So tighten the typechecking to ensure that that is what we actually get. --- mesonbuild/interpreter/interpreter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mesonbuild/interpreter') diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py index bd71f78..40815d0 100644 --- a/mesonbuild/interpreter/interpreter.py +++ b/mesonbuild/interpreter/interpreter.py @@ -103,8 +103,8 @@ def _project_version_validator(value: T.Union[T.List, str, mesonlib.File, None]) if isinstance(value, list): if len(value) != 1: return 'when passed as array must have a length of 1' - elif not isinstance(value[0], (str, mesonlib.File)): - return 'when passed as array must contain a string or File' + elif not isinstance(value[0], mesonlib.File): + return 'when passed as array must contain a File' return None -- cgit v1.1