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.
pull/9303/head
Eli Schwartz 3 years ago
parent 7f0193e294
commit 941b8a6dbc
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
  1. 2
      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):

Loading…
Cancel
Save