diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2021-09-26 22:11:36 -0400 |
---|---|---|
committer | Eli Schwartz <eschwartz@archlinux.org> | 2021-09-26 23:23:07 -0400 |
commit | 941b8a6dbcd538e3313fad1be45290b59f92df91 (patch) | |
tree | 3fcfe1af458323d29ce3d952edb2220a72ae1e21 | |
parent | 7f0193e294b731f595ae2c74eef0b4c256f9bb72 (diff) | |
download | meson-941b8a6dbcd538e3313fad1be45290b59f92df91.zip meson-941b8a6dbcd538e3313fad1be45290b59f92df91.tar.gz meson-941b8a6dbcd538e3313fad1be45290b59f92df91.tar.bz2 |
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.
-rw-r--r-- | mesonbuild/interpreter/interpreter.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py index 7a935da..c452251 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): |