From 941b8a6dbcd538e3313fad1be45290b59f92df91 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Sun, 26 Sep 2021 22:11:36 -0400 Subject: [PATCH] fix message function accepting bools and casting to string This was allowed by accident despite what meson said would work, because in python a bool counts as a subclass of int. --- mesonbuild/interpreter/interpreter.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py index 7a935dac6..c45225162 100644 --- a/mesonbuild/interpreter/interpreter.py +++ b/mesonbuild/interpreter/interpreter.py @@ -91,6 +91,8 @@ def stringifyUserArguments(args, quote=False): return '[%s]' % ', '.join([stringifyUserArguments(x, True) for x in args]) 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 elif isinstance(args, int): return str(args) elif isinstance(args, str):