mirror of
https://github.com/micropython/micropython.git
synced 2026-03-18 23:00:18 +01:00
py/objexcept: Allow compression of exception message text.
The decompression of error-strings is only done if the string is accessed via printing or via er.args. Tests are added for this feature to ensure the decompression works.
This commit is contained in:
committed by
Damien George
parent
92c83bd16b
commit
85858e72df
@@ -197,7 +197,7 @@ STATIC void compile_error_set_line(compiler_t *comp, mp_parse_node_t pn) {
|
||||
}
|
||||
}
|
||||
|
||||
STATIC void compile_syntax_error(compiler_t *comp, mp_parse_node_t pn, const char *msg) {
|
||||
STATIC void compile_syntax_error(compiler_t *comp, mp_parse_node_t pn, mp_rom_error_text_t msg) {
|
||||
// only register the error if there has been no other error
|
||||
if (comp->compile_error == MP_OBJ_NULL) {
|
||||
comp->compile_error = mp_obj_new_exception_msg(&mp_type_SyntaxError, msg);
|
||||
|
||||
Reference in New Issue
Block a user