From 3754c4a04035d18b0bbb780fa0aef273e1c8f033 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Mon, 20 Jan 2014 18:20:57 +0200 Subject: [PATCH] mp_obj_get_qstr(): Handle MP_OBJ_QSTR. --- py/obj.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/py/obj.c b/py/obj.c index 42f86cf17..dd081ee35 100644 --- a/py/obj.c +++ b/py/obj.c @@ -222,7 +222,9 @@ void mp_obj_get_complex(mp_obj_t arg, mp_float_t *real, mp_float_t *imag) { #endif qstr mp_obj_get_qstr(mp_obj_t arg) { - if (MP_OBJ_IS_TYPE(arg, &str_type)) { + if (MP_OBJ_IS_QSTR(arg)) { + return MP_OBJ_QSTR_VALUE(arg); + } else if (MP_OBJ_IS_TYPE(arg, &str_type)) { return mp_obj_str_get(arg); } else { assert(0);