py/persistentcode: Allow to compile with complex numbers disabled.

This commit is contained in:
Damien George 2017-06-08 00:28:28 +10:00
parent 4d2778c9fb
commit 72732fea1a
1 changed files with 6 additions and 4 deletions

View File

@ -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;