From 6298e2907082aff0763a09165c6c2841ac869e2d Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Mon, 25 Oct 2021 09:43:25 -0400 Subject: message: Allow bool It has always been working even if not documented and there is no reason to not accept it. However, change "True/False" to "true/false" to be consistent with meson language. Fixes: #9436 --- mesonbuild/interpreter/interpreter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mesonbuild/interpreter/interpreter.py') diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py index bbe89fa..fd00e70 100644 --- a/mesonbuild/interpreter/interpreter.py +++ b/mesonbuild/interpreter/interpreter.py @@ -103,12 +103,12 @@ def stringifyUserArguments(args, quote=False): elif isinstance(args, dict): return '{%s}' % ', '.join(['{} : {}'.format(stringifyUserArguments(k, True), stringifyUserArguments(v, True)) for k, v in args.items()]) elif isinstance(args, bool): - pass # bools are a type of int, make this fallthrough to the error case + return 'true' if args else 'false' elif isinstance(args, int): return str(args) elif isinstance(args, str): return f"'{args}'" if quote else args - raise InvalidArguments('Function accepts only strings, integers, lists, dictionaries and lists thereof.') + raise InvalidArguments('Function accepts only strings, integers, bools, lists, dictionaries and lists thereof.') class Summary: def __init__(self, project_name, project_version): -- cgit v1.1