Skip to content

Commit

Permalink
cmake: Change assertion into a more useful error (fixes #9925)
Browse files Browse the repository at this point in the history
  • Loading branch information
mensinda authored and nirbheek committed Aug 8, 2022
1 parent 3b593c4 commit e51a817
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mesonbuild/envconfig.py
Expand Up @@ -439,7 +439,8 @@ def __init__(self, variables: T.Optional[T.Dict[str, T.Any]] = None) -> None:
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]]:
Expand Down

0 comments on commit e51a817

Please sign in to comment.