diff --git a/lib/utils/pyexec.c b/lib/utils/pyexec.c index 31885b94dc..c1bb66aad1 100644 --- a/lib/utils/pyexec.c +++ b/lib/utils/pyexec.c @@ -370,7 +370,7 @@ STATIC int pyexec_raw_repl_process_char(int c) { } goto reset; } - mp_hal_stdout_tx_str("raw REPL; CTRL-B to exit\r\n"); + serial_write_compressed(translate("raw REPL; CTRL-B to exit\n")); goto reset; } else if (c == CHAR_CTRL_B) { // change to friendly REPL @@ -469,7 +469,7 @@ STATIC int pyexec_friendly_repl_process_char(int c) { return PYEXEC_FORCED_EXIT; } else if (ret == CHAR_CTRL_E) { // paste mode - mp_hal_stdout_tx_str("\r\npaste mode; Ctrl-C to cancel, Ctrl-D to finish\r\n=== "); + serial_write_compressed(translate("\npaste mode; Ctrl-C to cancel, Ctrl-D to finish\n=== ")); vstr_reset(MP_STATE_VM(repl_line)); repl.paste_mode = true; return 0; @@ -545,7 +545,7 @@ int pyexec_raw_repl(void) { vstr_init(&line, 32); raw_repl_reset: - mp_hal_stdout_tx_str("raw REPL; CTRL-B to exit\r\n"); + serial_write_compressed(translate("raw REPL; CTRL-B to exit\n")); for (;;) { vstr_reset(&line); diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index f0f07a4264..c6940b5594 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -35,6 +35,13 @@ msgid "" "https://github.com/adafruit/circuitpython/issues\n" msgstr "" +#: lib/utils/pyexec.c +msgid "" +"\n" +"paste mode; Ctrl-C to cancel, Ctrl-D to finish\n" +"=== " +msgstr "" + #: py/obj.c msgid " File \"%q\"" msgstr "" @@ -3973,6 +3980,10 @@ msgstr "" msgid "queue overflow" msgstr "" +#: lib/utils/pyexec.c +msgid "raw REPL; CTRL-B to exit\n" +msgstr "" + #: py/parse.c msgid "raw f-strings are not implemented" msgstr "" diff --git a/main.c b/main.c index ec25bcbf08..2b4327ad93 100755 --- a/main.c +++ b/main.c @@ -212,10 +212,7 @@ STATIC bool maybe_run_list(const char * const * filenames, pyexec_result_t* exec return false; } mp_hal_stdout_tx_str(filename); - const compressed_string_t* compressed = translate(" output:\n"); - char decompressed[decompress_length(compressed)]; - decompress(compressed, decompressed); - mp_hal_stdout_tx_str(decompressed); + serial_write_compressed(translate(" output:\n")); pyexec_file(filename, exec_result); #if CIRCUITPY_ATEXIT shared_module_atexit_execute(exec_result); diff --git a/py/objgenerator.c b/py/objgenerator.c index 7bafd9ce98..f7bf235848 100644 --- a/py/objgenerator.c +++ b/py/objgenerator.c @@ -185,11 +185,13 @@ STATIC void gen_instance_print(const mp_print_t *print, mp_obj_t self_in, mp_pri mp_obj_gen_instance_t *self = MP_OBJ_TO_PTR(self_in); #if MICROPY_PY_ASYNC_AWAIT if (self->coroutine_generator) { - mp_printf(print, "", mp_obj_fun_get_name(MP_OBJ_FROM_PTR(self->code_state.fun_bc)), self); - return; + mp_printf(print, "<%q object '%q' at %p>", MP_QSTR_coroutine, mp_obj_fun_get_name(MP_OBJ_FROM_PTR(self->code_state.fun_bc)), self); + } else { + mp_printf(print, "<%q object '%q' at %p>", MP_QSTR_generator, mp_obj_fun_get_name(MP_OBJ_FROM_PTR(self->code_state.fun_bc)), self); } - #endif + #else mp_printf(print, "", mp_obj_fun_get_name(MP_OBJ_FROM_PTR(self->code_state.fun_bc)), self); + #endif } mp_vm_return_kind_t mp_obj_gen_resume(mp_obj_t self_in, mp_obj_t send_value, mp_obj_t throw_value, mp_obj_t *ret_val) { diff --git a/py/objtraceback.c b/py/objtraceback.c index f1f74142d6..989521a0a6 100644 --- a/py/objtraceback.c +++ b/py/objtraceback.c @@ -32,7 +32,7 @@ const mp_obj_traceback_t mp_const_empty_traceback_obj = {{&mp_type_traceback}, 0 STATIC void mp_obj_traceback_print(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_t kind) { (void)kind; mp_obj_traceback_t *o = MP_OBJ_TO_PTR(o_in); - mp_printf(print, "", o); + mp_printf(print, "<%q object at %p>", MP_QSTR_traceback, o); } const mp_obj_type_t mp_type_traceback = {