summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2018-12-06 23:45:35 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2018-12-06 23:45:35 +0200
commit4bb0333ef81f585d743df3db6793a0c2b6bb6693 (patch)
tree54b85ff903243526b535e0b867317354b07dce6f
parentc44a5a1aeca638f46b4a2d8d4a9fcb0a554037df (diff)
downloadmeson-kwargskwargs.tar.gz
Error out if kwargs dict contains a kwargs entry.kwargskwargs
Yo dawg! We heard U don't like kwargs in kwargs, so we made it impossible to put kwargs in your kwargs so now you can't kwargs with your kwargs.
-rw-r--r--mesonbuild/interpreterbase.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/mesonbuild/interpreterbase.py b/mesonbuild/interpreterbase.py
index 159459436..707b8f702 100644
--- a/mesonbuild/interpreterbase.py
+++ b/mesonbuild/interpreterbase.py
@@ -999,7 +999,9 @@ The result of this is undefined and will become a hard error in a future Meson r
return kwargs
to_expand = kwargs.pop('kwargs')
if not isinstance(to_expand, dict):
- raise InterpreterException('Value of "kwarg" must be dictionary.')
+ raise InterpreterException('Value of "kwargs" must be dictionary.')
+ if 'kwargs' in to_expand:
+ raise InterpreterException('Kwargs argument must not contain a "kwargs" entry. Points for thinking meta, though. :P')
for k, v in to_expand.items():
if k in kwargs:
raise InterpreterException('Entry "{}" defined both as a keyword argument and in a "kwarg" entry.'.format(k))