summaryrefslogtreecommitdiffstatshomepage
path: root/py/obj.c
diff options
context:
space:
mode:
Diffstat (limited to 'py/obj.c')
-rw-r--r--py/obj.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/py/obj.c b/py/obj.c
index 9ca3d5d16b..c6e665376a 100644
--- a/py/obj.c
+++ b/py/obj.c
@@ -63,7 +63,7 @@ bool mp_obj_is_callable(mp_obj_t o_in) {
return false;
} else {
mp_obj_base_t *o = o_in;
- return o->type->call_n != NULL;
+ return o->type->call != NULL;
}
}
@@ -155,6 +155,8 @@ machine_int_t mp_obj_get_int(mp_obj_t arg) {
return 1;
} else if (MP_OBJ_IS_SMALL_INT(arg)) {
return MP_OBJ_SMALL_INT_VALUE(arg);
+ } else if (MP_OBJ_IS_TYPE(arg, &int_type)) {
+ return mp_obj_int_get_checked(arg);
#if MICROPY_ENABLE_FLOAT
} else if (MP_OBJ_IS_TYPE(arg, &float_type)) {
// TODO work out if this should be floor, ceil or trunc