From 3730090d8f028dc76aee33718b1282f0dad9de6c Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Sat, 22 Oct 2016 01:07:07 +0300 Subject: [PATCH] py/{modbuiltins,obj}: Use MP_PYTHON_PRINTER where possible. --- py/modbuiltins.c | 9 ++------- py/obj.c | 6 +----- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/py/modbuiltins.c b/py/modbuiltins.c index 57e52efa52..b295dae629 100644 --- a/py/modbuiltins.c +++ b/py/modbuiltins.c @@ -430,13 +430,8 @@ MP_DEFINE_CONST_FUN_OBJ_KW(mp_builtin_print_obj, 0, mp_builtin_print); STATIC mp_obj_t mp_builtin___repl_print__(mp_obj_t o) { if (o != mp_const_none) { - #if MICROPY_PY_IO - mp_obj_print_helper(&mp_sys_stdout_print, o, PRINT_REPR); - mp_print_str(&mp_sys_stdout_print, "\n"); - #else - mp_obj_print_helper(&mp_plat_print, o, PRINT_REPR); - mp_print_str(&mp_plat_print, "\n"); - #endif + mp_obj_print_helper(MP_PYTHON_PRINTER, o, PRINT_REPR); + mp_print_str(MP_PYTHON_PRINTER, "\n"); #if MICROPY_CAN_OVERRIDE_BUILTINS // Set "_" special variable mp_obj_t dest[2] = {MP_OBJ_SENTINEL, o}; diff --git a/py/obj.c b/py/obj.c index 72b7a216bc..5601a73fe7 100644 --- a/py/obj.c +++ b/py/obj.c @@ -76,11 +76,7 @@ void mp_obj_print_helper(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_t } void mp_obj_print(mp_obj_t o_in, mp_print_kind_t kind) { -#if MICROPY_PY_IO - mp_obj_print_helper(&mp_sys_stdout_print, o_in, kind); -#else - mp_obj_print_helper(&mp_plat_print, o_in, kind); -#endif + mp_obj_print_helper(MP_PYTHON_PRINTER, o_in, kind); } // helper function to print an exception with traceback