summaryrefslogtreecommitdiffstatshomepage
path: root/py/runtime.c
diff options
context:
space:
mode:
Diffstat (limited to 'py/runtime.c')
-rw-r--r--py/runtime.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/py/runtime.c b/py/runtime.c
index 9d41f059f5..7034ce13c0 100644
--- a/py/runtime.c
+++ b/py/runtime.c
@@ -92,13 +92,13 @@ STATIC const mp_builtin_elem_t builtin_table[] = {
// built-in types
{ MP_QSTR_bool, (mp_obj_t)&bool_type },
#if MICROPY_ENABLE_FLOAT
- { MP_QSTR_complex, (mp_obj_t)&complex_type },
+ { MP_QSTR_complex, (mp_obj_t)&mp_type_complex },
#endif
{ MP_QSTR_dict, (mp_obj_t)&dict_type },
{ MP_QSTR_enumerate, (mp_obj_t)&enumerate_type },
{ MP_QSTR_filter, (mp_obj_t)&filter_type },
#if MICROPY_ENABLE_FLOAT
- { MP_QSTR_float, (mp_obj_t)&float_type },
+ { MP_QSTR_float, (mp_obj_t)&mp_type_float },
#endif
{ MP_QSTR_int, (mp_obj_t)&int_type },
{ MP_QSTR_list, (mp_obj_t)&list_type },
@@ -203,7 +203,9 @@ void rt_init(void) {
//sys_path = mp_obj_new_list(0, NULL);
//rt_store_attr(m_sys, MP_QSTR_path, sys_path);
- mp_module_micropython_init();
+ // we pre-import the micropython module
+ // probably shouldn't do this, so we are compatible with CPython
+ rt_store_name(MP_QSTR_micropython, (mp_obj_t)&mp_module_micropython);
// TODO: wastes one mp_code_t structure in mem
next_unique_code_id = 1; // 0 indicates "no code"
@@ -586,9 +588,9 @@ mp_obj_t rt_binary_op(int op, mp_obj_t lhs, mp_obj_t rhs) {
}
return mp_obj_new_int(lhs_val);
#if MICROPY_ENABLE_FLOAT
- } else if (MP_OBJ_IS_TYPE(rhs, &float_type)) {
+ } else if (MP_OBJ_IS_TYPE(rhs, &mp_type_float)) {
return mp_obj_float_binary_op(op, lhs_val, rhs);
- } else if (MP_OBJ_IS_TYPE(rhs, &complex_type)) {
+ } else if (MP_OBJ_IS_TYPE(rhs, &mp_type_complex)) {
return mp_obj_complex_binary_op(op, lhs_val, 0, rhs);
#endif
}