Improve "Passed invalid keyword argument" warning.

I got this warning on a build:
> WARNING: Passed invalid keyword argument preset. This will become a hard error in the future.
I had to grep in meson code to understand that "preset" was the name of
the invalid argument. This is not obvious at all depending on the
argument name (here it looked like it was about argument presets).
Let's make it clearer by putting it in quotes.
pull/2024/head
Jehan 8 years ago committed by Jussi Pakkanen
parent d80787ae28
commit 2f691410fc
  1. 2
      mesonbuild/interpreterbase.py
  2. 2
      mesonbuild/modules/__init__.py

@ -64,7 +64,7 @@ class permittedKwargs:
def wrapped(s, node, args, kwargs):
for k in kwargs:
if k not in self.permitted:
mlog.warning('Passed invalid keyword argument %s. This will become a hard error in the future.' % k)
mlog.warning('Passed invalid keyword argument "%s". This will become a hard error in the future.' % k)
return f(s, node, args, kwargs)
return wrapped

@ -15,7 +15,7 @@ class permittedSnippetKwargs:
def wrapped(s, interpreter, state, args, kwargs):
for k in kwargs:
if k not in self.permitted:
mlog.warning('Passed invalid keyword argument %s. This will become a hard error in the future.' % k)
mlog.warning('Passed invalid keyword argument "%s". This will become a hard error in the future.' % k)
return f(s, interpreter, state, args, kwargs)
return wrapped

Loading…
Cancel
Save