mp_obj_get_type_str(): Handle MP_OBJ_QSTR.

This commit is contained in:
Paul Sokolovsky 2014-01-20 23:00:26 +02:00
parent d991da7263
commit e6da0df6d1
1 changed files with 2 additions and 0 deletions

View File

@ -28,6 +28,8 @@ mp_obj_t mp_obj_get_type(mp_obj_t o_in) {
const char *mp_obj_get_type_str(mp_obj_t o_in) { const char *mp_obj_get_type_str(mp_obj_t o_in) {
if (MP_OBJ_IS_SMALL_INT(o_in)) { if (MP_OBJ_IS_SMALL_INT(o_in)) {
return "int"; return "int";
} else if (MP_OBJ_IS_QSTR(o_in)) {
return "str";
} else { } else {
mp_obj_base_t *o = o_in; mp_obj_base_t *o = o_in;
return o->type->name; return o->type->name;