mirror of
https://github.com/micropython/micropython.git
synced 2026-01-08 05:00:26 +01:00
objexcept: No more magic messages in exceptions, only exception arguments.
One of the reason for separate "message" (besides still unfulfilled desire to optimize memory usage) was apparent special handling of exception with messages by CPython. Well, the message is still just an exception argument, it just printed specially. Implement that with PRINT_EXC printing format.
This commit is contained in:
4
py/obj.h
4
py/obj.h
@@ -141,7 +141,9 @@ typedef mp_obj_t (*mp_fun_var_t)(uint n, const mp_obj_t *);
|
||||
typedef mp_obj_t (*mp_fun_kw_t)(uint n, const mp_obj_t *, mp_map_t *);
|
||||
|
||||
typedef enum {
|
||||
PRINT_STR, PRINT_REPR
|
||||
PRINT_STR,
|
||||
PRINT_REPR,
|
||||
PRINT_EXC, // Special format for printing exception in unhandled exception message
|
||||
} mp_print_kind_t;
|
||||
|
||||
typedef void (*mp_print_fun_t)(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t o, mp_print_kind_t kind);
|
||||
|
||||
Reference in New Issue
Block a user