Skip to content

Commit d8d3e6a

Browse files
committed
py: Make builtin modules use MP_REGISTER_MODULE.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
1 parent 4eab44a commit d8d3e6a

12 files changed

Lines changed: 23 additions & 33 deletions

py/modbuiltins.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -784,3 +784,5 @@ const mp_obj_module_t mp_module_builtins = {
784784
.base = { &mp_type_module },
785785
.globals = (mp_obj_dict_t *)&mp_module_builtins_globals,
786786
};
787+
788+
MP_REGISTER_MODULE(MP_QSTR_builtins, mp_module_builtins, 1);

py/modcmath.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,4 +149,6 @@ const mp_obj_module_t mp_module_cmath = {
149149
.globals = (mp_obj_dict_t *)&mp_module_cmath_globals,
150150
};
151151

152-
#endif // MICROPY_PY_BUILTINS_FLOAT && MICROPY_PY_CMATH
152+
MP_REGISTER_MODULE(MP_QSTR_cmath, mp_module_cmath, MICROPY_PY_BUILTINS_FLOAT && MICROPY_PY_BUILTINS_COMPLEX && MICROPY_PY_CMATH);
153+
154+
#endif // MICROPY_PY_BUILTINS_FLOAT && MICROPY_PY_BUILTINS_COMPLEX && MICROPY_PY_CMATH

py/modcollections.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,6 @@ const mp_obj_module_t mp_module_collections = {
4646
.globals = (mp_obj_dict_t *)&mp_module_collections_globals,
4747
};
4848

49+
MP_REGISTER_MODULE(MP_QSTR_ucollections, mp_module_collections, MICROPY_PY_COLLECTIONS);
50+
4951
#endif // MICROPY_PY_COLLECTIONS

py/modgc.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,6 @@ const mp_obj_module_t mp_module_gc = {
115115
.globals = (mp_obj_dict_t *)&mp_module_gc_globals,
116116
};
117117

118+
MP_REGISTER_MODULE(MP_QSTR_gc, mp_module_gc, MICROPY_PY_GC && MICROPY_ENABLE_GC);
119+
118120
#endif

py/modio.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,4 +233,6 @@ const mp_obj_module_t mp_module_io = {
233233
.globals = (mp_obj_dict_t *)&mp_module_io_globals,
234234
};
235235

236+
MP_REGISTER_MODULE(MP_QSTR_uio, mp_module_io, MICROPY_PY_IO);
237+
236238
#endif

py/modmath.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,4 +435,6 @@ const mp_obj_module_t mp_module_math = {
435435
.globals = (mp_obj_dict_t *)&mp_module_math_globals,
436436
};
437437

438+
MP_REGISTER_MODULE(MP_QSTR_math, mp_module_math, MICROPY_PY_BUILTINS_FLOAT && MICROPY_PY_MATH);
439+
438440
#endif // MICROPY_PY_BUILTINS_FLOAT && MICROPY_PY_MATH

py/modmicropython.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,3 +209,5 @@ const mp_obj_module_t mp_module_micropython = {
209209
.base = { &mp_type_module },
210210
.globals = (mp_obj_dict_t *)&mp_module_micropython_globals,
211211
};
212+
213+
MP_REGISTER_MODULE(MP_QSTR_micropython, mp_module_micropython, 1);

py/modstruct.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,4 +266,6 @@ const mp_obj_module_t mp_module_ustruct = {
266266
.globals = (mp_obj_dict_t *)&mp_module_struct_globals,
267267
};
268268

269+
MP_REGISTER_MODULE(MP_QSTR_ustruct, mp_module_ustruct, MICROPY_PY_STRUCT);
270+
269271
#endif

py/modsys.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,4 +284,6 @@ const mp_obj_module_t mp_module_sys = {
284284
.globals = (mp_obj_dict_t *)&mp_module_sys_globals,
285285
};
286286

287+
MP_REGISTER_MODULE(MP_QSTR_usys, mp_module_sys, MICROPY_PY_SYS);
288+
287289
#endif

py/modthread.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,4 +300,6 @@ const mp_obj_module_t mp_module_thread = {
300300
.globals = (mp_obj_dict_t *)&mp_module_thread_globals,
301301
};
302302

303+
MP_REGISTER_MODULE(MP_QSTR__thread, mp_module_thread, MICROPY_PY_THREAD);
304+
303305
#endif // MICROPY_PY_THREAD

0 commit comments

Comments
 (0)