summaryrefslogtreecommitdiff
path: root/tests/basics/fun_calldblstar.py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2018-03-30 11:09:00 +1100
committerDamien George <damien.p.george@gmail.com>2018-03-30 11:13:32 +1100
commit32807881954f106b9735de74fe984062a0815b81 (patch)
tree191a534e36c54c7c26005864045996fc87f6abb8 /tests/basics/fun_calldblstar.py
parentbc3a5f191714f28bef95d9f87c24f7367c90d54a (diff)
py/runtime: Check that keys in dicts passed as ** args are strings.
Prior to this patch the code would crash if a key in a ** dict was anything other than a str or qstr. This is because mp_setup_code_state() assumes that keys in kwargs are qstrs (for efficiency). Thanks to @jepler for finding the bug.
Diffstat (limited to 'tests/basics/fun_calldblstar.py')
-rw-r--r--tests/basics/fun_calldblstar.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/basics/fun_calldblstar.py b/tests/basics/fun_calldblstar.py
index aae9828cf..4a503698f 100644
--- a/tests/basics/fun_calldblstar.py
+++ b/tests/basics/fun_calldblstar.py
@@ -6,6 +6,11 @@ def f(a, b):
f(1, **{'b':2})
f(1, **{'b':val for val in range(1)})
+try:
+ f(1, **{len:2})
+except TypeError:
+ print('TypeError')
+
# test calling a method with keywords given by **dict
class A: