summaryrefslogtreecommitdiffstatshomepage
path: root/py/obj.c
diff options
context:
space:
mode:
Diffstat (limited to 'py/obj.c')
-rw-r--r--py/obj.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/py/obj.c b/py/obj.c
index 86bc7c211c..3deee909a6 100644
--- a/py/obj.c
+++ b/py/obj.c
@@ -195,6 +195,9 @@ void mp_obj_get_complex(mp_obj_t arg, mp_float_t *real, mp_float_t *imag) {
} else if (MP_OBJ_IS_SMALL_INT(arg)) {
*real = MP_OBJ_SMALL_INT_VALUE(arg);
*imag = 0;
+ } else if (MP_OBJ_IS_TYPE(arg, &mp_type_int)) {
+ *real = mp_obj_int_as_float(arg);
+ *imag = 0;
} else if (MP_OBJ_IS_TYPE(arg, &mp_type_float)) {
*real = mp_obj_float_get(arg);
*imag = 0;