Skip to content

Commit e5039c6

Browse files
committed
py: Use TextIOWrapper only if PY_IO_FILEIO def'd; cast size_t for print.
1 parent f80f1a7 commit e5039c6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

py/modio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ STATIC const mp_map_elem_t mp_module_io_globals_table[] = {
3838
{ MP_OBJ_NEW_QSTR(MP_QSTR_open), (mp_obj_t)&mp_builtin_open_obj },
3939
#if MICROPY_PY_IO_FILEIO
4040
{ MP_OBJ_NEW_QSTR(MP_QSTR_FileIO), (mp_obj_t)&mp_type_fileio },
41-
#endif
4241
#if MICROPY_CPYTHON_COMPAT
4342
{ MP_OBJ_NEW_QSTR(MP_QSTR_TextIOWrapper), (mp_obj_t)&mp_type_textio },
4443
#endif
44+
#endif
4545
{ MP_OBJ_NEW_QSTR(MP_QSTR_StringIO), (mp_obj_t)&mp_type_stringio },
4646
#if MICROPY_PY_IO_BYTESIO
4747
{ MP_OBJ_NEW_QSTR(MP_QSTR_BytesIO), (mp_obj_t)&mp_type_bytesio },

py/modmicropython.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ mp_obj_t mp_micropython_mem_info(mp_uint_t n_args, const mp_obj_t *args) {
5757
(void)args;
5858
#if MICROPY_MEM_STATS
5959
printf("mem: total=" UINT_FMT ", current=" UINT_FMT ", peak=" UINT_FMT "\n",
60-
m_get_total_bytes_allocated(), m_get_current_bytes_allocated(), m_get_peak_bytes_allocated());
60+
(mp_uint_t)m_get_total_bytes_allocated(), (mp_uint_t)m_get_current_bytes_allocated(), (mp_uint_t)m_get_peak_bytes_allocated());
6161
#endif
6262
#if MICROPY_STACK_CHECK
6363
printf("stack: " UINT_FMT " out of " INT_FMT "\n", mp_stack_usage(), MP_STATE_VM(stack_limit));

0 commit comments

Comments
 (0)