mirror of
https://github.com/micropython/micropython.git
synced 2026-01-04 19:20:22 +01:00
py: Use preprocessor to detect error reporting level (terse/detailed).
Instead of compiler-level if-logic. This is necessary to know what error strings are included in the build at the preprocessor stage, so that string compression can be implemented.
This commit is contained in:
committed by
Damien George
parent
312c699491
commit
a9a745e4b4
12
py/bc.c
12
py/bc.c
@@ -212,12 +212,12 @@ void mp_setup_code_state(mp_code_state_t *code_state, size_t n_args, size_t n_kw
|
||||
}
|
||||
// Didn't find name match with positional args
|
||||
if ((scope_flags & MP_SCOPE_FLAG_VARKEYWORDS) == 0) {
|
||||
if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) {
|
||||
mp_raise_TypeError("unexpected keyword argument");
|
||||
} else {
|
||||
mp_raise_msg_varg(&mp_type_TypeError,
|
||||
"unexpected keyword argument '%q'", MP_OBJ_QSTR_VALUE(wanted_arg_name));
|
||||
}
|
||||
#if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE
|
||||
mp_raise_TypeError("unexpected keyword argument");
|
||||
#else
|
||||
mp_raise_msg_varg(&mp_type_TypeError,
|
||||
"unexpected keyword argument '%q'", MP_OBJ_QSTR_VALUE(wanted_arg_name));
|
||||
#endif
|
||||
}
|
||||
mp_obj_dict_store(dict, kwargs[2 * i], kwargs[2 * i + 1]);
|
||||
continue2:;
|
||||
|
||||
Reference in New Issue
Block a user