mp_obj_get_qstr(): Handle MP_OBJ_QSTR.

This commit is contained in:
Paul Sokolovsky 2014-01-20 18:20:57 +02:00
parent 91d457a277
commit 3754c4a040

View file

@ -222,7 +222,9 @@ void mp_obj_get_complex(mp_obj_t arg, mp_float_t *real, mp_float_t *imag) {
#endif #endif
qstr mp_obj_get_qstr(mp_obj_t arg) { 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); return mp_obj_str_get(arg);
} else { } else {
assert(0); assert(0);