aboutsummaryrefslogtreecommitdiff
path: root/py/bc.c
diff options
context:
space:
mode:
authorJim Mussared <jim.mussared@gmail.com>2019-09-26 22:52:04 +1000
committerDamien George <damien.p.george@gmail.com>2020-04-05 14:11:51 +1000
commita9a745e4b4838749a47857f1d0c95de52dc85f58 (patch)
tree60469e58476c5a68999ad0a2e8d58dbca8a6abb8 /py/bc.c
parent312c699491830daacd33f032a6d6fc6cc6ff0c96 (diff)
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.
Diffstat (limited to 'py/bc.c')
-rw-r--r--py/bc.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/py/bc.c b/py/bc.c
index 34b928423..28bed75cc 100644
--- a/py/bc.c
+++ b/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:;