Browse Source

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

pull/3126/head
Damien George 8 years ago
parent
commit
72732fea1a
  1. 10
      py/persistentcode.c

10
py/persistentcode.c

@ -286,11 +286,13 @@ STATIC void save_obj(mp_print_t *print, mp_obj_t o) {
byte obj_type; byte obj_type;
if (MP_OBJ_IS_TYPE(o, &mp_type_int)) { if (MP_OBJ_IS_TYPE(o, &mp_type_int)) {
obj_type = 'i'; obj_type = 'i';
} else if (mp_obj_is_float(o)) { #if MICROPY_PY_BUILTINS_COMPLEX
obj_type = 'f'; } else if (MP_OBJ_IS_TYPE(o, &mp_type_complex)) {
} else {
assert(MP_OBJ_IS_TYPE(o, &mp_type_complex));
obj_type = 'c'; obj_type = 'c';
#endif
} else {
assert(mp_obj_is_float(o));
obj_type = 'f';
} }
vstr_t vstr; vstr_t vstr;
mp_print_t pr; mp_print_t pr;

Loading…
Cancel
Save