summaryrefslogtreecommitdiff
path: root/py/objnamedtuple.c
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2021-04-22 12:13:58 +1000
committerDamien George <damien@micropython.org>2021-04-27 23:51:52 +1000
commitd4b706c4d01377d42855ff1544ced77536f69caf (patch)
treecfdb78c011813396af745720c1a7754ac91487d7 /py/objnamedtuple.c
parent30d9f77cc535306eeb9eed6f17e71355fd58995a (diff)
py: Add option to compile without any error messages at all.
This introduces a new option, MICROPY_ERROR_REPORTING_NONE, which completely disables all error messages. To be used in cases where MicroPython needs to fit in very limited systems. Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'py/objnamedtuple.c')
-rw-r--r--py/objnamedtuple.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/py/objnamedtuple.c b/py/objnamedtuple.c
index e4543f5b9..214cad257 100644
--- a/py/objnamedtuple.c
+++ b/py/objnamedtuple.c
@@ -95,7 +95,7 @@ STATIC mp_obj_t namedtuple_make_new(const mp_obj_type_t *type_in, size_t n_args,
const mp_obj_namedtuple_type_t *type = (const mp_obj_namedtuple_type_t *)type_in;
size_t num_fields = type->n_fields;
if (n_args + n_kw != num_fields) {
- #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE
+ #if MICROPY_ERROR_REPORTING <= MICROPY_ERROR_REPORTING_TERSE
mp_arg_error_terse_mismatch();
#elif MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_NORMAL
mp_raise_msg_varg(&mp_type_TypeError,
@@ -121,14 +121,14 @@ STATIC mp_obj_t namedtuple_make_new(const mp_obj_type_t *type_in, size_t n_args,
qstr kw = mp_obj_str_get_qstr(args[i]);
size_t id = mp_obj_namedtuple_find_field(type, kw);
if (id == (size_t)-1) {
- #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE
+ #if MICROPY_ERROR_REPORTING <= MICROPY_ERROR_REPORTING_TERSE
mp_arg_error_terse_mismatch();
#else
mp_raise_msg_varg(&mp_type_TypeError, MP_ERROR_TEXT("unexpected keyword argument '%q'"), kw);
#endif
}
if (tuple->items[id] != MP_OBJ_NULL) {
- #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE
+ #if MICROPY_ERROR_REPORTING <= MICROPY_ERROR_REPORTING_TERSE
mp_arg_error_terse_mismatch();
#else
mp_raise_msg_varg(&mp_type_TypeError,