diff options
Diffstat (limited to 'py/obj.c')
| -rw-r--r-- | py/obj.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -33,6 +33,7 @@ #include "py/obj.h" #include "py/objtype.h" #include "py/objint.h" +#include "py/objstr.h" #include "py/runtime0.h" #include "py/runtime.h" #include "py/stackctrl.h" @@ -422,7 +423,8 @@ mp_obj_t mp_obj_len_maybe(mp_obj_t o_in) { MP_OBJ_IS_STR(o_in) || #endif MP_OBJ_IS_TYPE(o_in, &mp_type_bytes)) { - return MP_OBJ_NEW_SMALL_INT(mp_obj_str_get_len(o_in)); + GET_STR_LEN(o_in, l); + return MP_OBJ_NEW_SMALL_INT(l); } else { mp_obj_type_t *type = mp_obj_get_type(o_in); if (type->unary_op != NULL) { |
