aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mensinger <daniel@mensinger-ka.de>2022-07-18 17:06:45 +0200
committerNirbheek Chauhan <nirbheek@centricular.com>2022-08-08 19:10:32 +0530
commite51a817b256f393183628da39bac9b36b98434b9 (patch)
tree7001d9c640a73aef07e855ebe03a777c97162f95
parent3b593c4390562c9a64429193ae094556631250f4 (diff)
downloadmeson-e51a817b256f393183628da39bac9b36b98434b9.zip
meson-e51a817b256f393183628da39bac9b36b98434b9.tar.gz
meson-e51a817b256f393183628da39bac9b36b98434b9.tar.bz2
cmake: Change assertion into a more useful error (fixes #9925)
-rw-r--r--mesonbuild/envconfig.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/mesonbuild/envconfig.py b/mesonbuild/envconfig.py
index 820bc99..0e47c05 100644
--- a/mesonbuild/envconfig.py
+++ b/mesonbuild/envconfig.py
@@ -439,7 +439,8 @@ class CMakeVariables:
for key, value in variables.items():
value = mesonlib.listify(value)
for i in value:
- assert isinstance(i, str)
+ if not isinstance(i, str):
+ raise EnvironmentException(f"Value '{i}' of CMake variable '{key}' defined in a machine file is a {type(i).__name__} and not a str")
self.variables[key] = value
def get_variables(self) -> T.Dict[str, T.List[str]]: