From fea40ad46815cb372312f8ae223efcb3b879dd0f Mon Sep 17 00:00:00 2001 From: Damien George Date: Thu, 21 Apr 2016 16:51:36 +0100 Subject: py: Fix bug passing a string as a keyword arg in a dict. Addresses issue #1998. --- py/bc.c | 1 + 1 file changed, 1 insertion(+) (limited to 'py/bc.c') diff --git a/py/bc.c b/py/bc.c index 750ca2aed8..5cdaa4770d 100644 --- a/py/bc.c +++ b/py/bc.c @@ -171,6 +171,7 @@ void mp_setup_code_state(mp_code_state *code_state, mp_obj_fun_bc_t *self, size_ const mp_obj_t *arg_names = (const mp_obj_t*)code_state->const_table; for (size_t i = 0; i < n_kw; i++) { + // the keys in kwargs are expected to be qstr objects mp_obj_t wanted_arg_name = kwargs[2 * i]; for (size_t j = 0; j < n_pos_args + n_kwonly_args; j++) { if (wanted_arg_name == arg_names[j]) { -- cgit v1.2.3