aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/interpreter
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2021-11-27 22:44:36 -0500
committerDaniel Mensinger <daniel@mensinger-ka.de>2022-01-24 19:46:51 +0100
commita0d28e850e3f112d7161b367261295796dc04858 (patch)
treef06cc8916288b741f9f7ee06aae84e9bfaec1156 /mesonbuild/interpreter
parent4f40962a05aae3881327ec04c02396153e5aa318 (diff)
downloadmeson-a0d28e850e3f112d7161b367261295796dc04858.zip
meson-a0d28e850e3f112d7161b367261295796dc04858.tar.gz
meson-a0d28e850e3f112d7161b367261295796dc04858.tar.bz2
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.
Diffstat (limited to 'mesonbuild/interpreter')
-rw-r--r--mesonbuild/interpreter/interpreter.py4
1 files changed, 2 insertions, 2 deletions
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