From 72732fea1a041b94448d98ad4fd53545caa758ab Mon Sep 17 00:00:00 2001 From: Damien George Date: Thu, 8 Jun 2017 00:28:28 +1000 Subject: [PATCH] py/persistentcode: Allow to compile with complex numbers disabled. --- py/persistentcode.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/py/persistentcode.c b/py/persistentcode.c index a71045a290..2fa8c1df07 100644 --- a/py/persistentcode.c +++ b/py/persistentcode.c @@ -286,11 +286,13 @@ STATIC void save_obj(mp_print_t *print, mp_obj_t o) { byte obj_type; if (MP_OBJ_IS_TYPE(o, &mp_type_int)) { obj_type = 'i'; - } else if (mp_obj_is_float(o)) { - obj_type = 'f'; - } else { - assert(MP_OBJ_IS_TYPE(o, &mp_type_complex)); + #if MICROPY_PY_BUILTINS_COMPLEX + } else if (MP_OBJ_IS_TYPE(o, &mp_type_complex)) { obj_type = 'c'; + #endif + } else { + assert(mp_obj_is_float(o)); + obj_type = 'f'; } vstr_t vstr; mp_print_t pr;