diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2018-12-06 23:45:35 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2018-12-07 21:35:26 +0200 |
commit | 95c620db675d48f58ffd509d12ff4414d60a320e (patch) | |
tree | 54b85ff903243526b535e0b867317354b07dce6f | |
parent | c44a5a1aeca638f46b4a2d8d4a9fcb0a554037df (diff) | |
download | meson-95c620db675d48f58ffd509d12ff4414d60a320e.zip meson-95c620db675d48f58ffd509d12ff4414d60a320e.tar.gz meson-95c620db675d48f58ffd509d12ff4414d60a320e.tar.bz2 |
Error out if kwargs dict contains a kwargs entry.
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.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mesonbuild/interpreterbase.py b/mesonbuild/interpreterbase.py index 1594594..707b8f7 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)) |