summaryrefslogtreecommitdiff
path: root/py/objcomplex.c
diff options
context:
space:
mode:
Diffstat (limited to 'py/objcomplex.c')
-rw-r--r--py/objcomplex.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/py/objcomplex.c b/py/objcomplex.c
index 3c4cb6614..4aa598a0b 100644
--- a/py/objcomplex.c
+++ b/py/objcomplex.c
@@ -89,11 +89,8 @@ STATIC mp_obj_t complex_make_new(const mp_obj_type_t *type_in, size_t n_args, si
return args[0];
} else {
mp_float_t real, imag;
- if (mp_obj_get_complex_maybe(args[0], &real, &imag)) {
- return mp_obj_new_complex(real, imag);
- }
- // something else, try to cast it to a complex
- return mp_obj_new_complex(mp_obj_get_float(args[0]), 0);
+ mp_obj_get_complex(args[0], &real, &imag);
+ return mp_obj_new_complex(real, imag);
}
case 2: