summaryrefslogtreecommitdiff
path: root/py/objnamedtuple.c
diff options
context:
space:
mode:
authorJim Mussared <jim.mussared@gmail.com>2020-03-02 22:35:22 +1100
committerDamien George <damien.p.george@gmail.com>2020-04-05 15:02:06 +1000
commitdef76fe4d9bbc2c342594dc05861b24d7165d274 (patch)
treed04ad778e2421de0a85835227ba5bcb08562ec24 /py/objnamedtuple.c
parent85858e72dfdc3e941c2e620e94de05ad663138b1 (diff)
all: Use MP_ERROR_TEXT for all error messages.
Diffstat (limited to 'py/objnamedtuple.c')
-rw-r--r--py/objnamedtuple.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/py/objnamedtuple.c b/py/objnamedtuple.c
index dacf5d64c..48111b0b4 100644
--- a/py/objnamedtuple.c
+++ b/py/objnamedtuple.c
@@ -87,7 +87,7 @@ STATIC void namedtuple_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) {
} else {
// delete/store attribute
// provide more detailed error message than we'd get by just returning
- mp_raise_msg(&mp_type_AttributeError, "can't set attribute");
+ mp_raise_msg(&mp_type_AttributeError, MP_ERROR_TEXT("can't set attribute"));
}
}
@@ -99,11 +99,11 @@ STATIC mp_obj_t namedtuple_make_new(const mp_obj_type_t *type_in, size_t n_args,
mp_arg_error_terse_mismatch();
#elif MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_NORMAL
mp_raise_msg_varg(&mp_type_TypeError,
- "function takes %d positional arguments but %d were given",
+ MP_ERROR_TEXT("function takes %d positional arguments but %d were given"),
num_fields, n_args + n_kw);
#elif MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_DETAILED
mp_raise_msg_varg(&mp_type_TypeError,
- "%q() takes %d positional arguments but %d were given",
+ MP_ERROR_TEXT("%q() takes %d positional arguments but %d were given"),
type->base.name, num_fields, n_args + n_kw);
#endif
}
@@ -124,7 +124,7 @@ STATIC mp_obj_t namedtuple_make_new(const mp_obj_type_t *type_in, size_t n_args,
#if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE
mp_arg_error_terse_mismatch();
#else
- mp_raise_msg_varg(&mp_type_TypeError, "unexpected keyword argument '%q'", kw);
+ mp_raise_msg_varg(&mp_type_TypeError, MP_ERROR_TEXT("unexpected keyword argument '%q'"), kw);
#endif
}
if (tuple->items[id] != MP_OBJ_NULL) {
@@ -132,7 +132,7 @@ STATIC mp_obj_t namedtuple_make_new(const mp_obj_type_t *type_in, size_t n_args,
mp_arg_error_terse_mismatch();
#else
mp_raise_msg_varg(&mp_type_TypeError,
- "function got multiple values for argument '%q'", kw);
+ MP_ERROR_TEXT("function got multiple values for argument '%q'"), kw);
#endif
}
tuple->items[id] = args[i + 1];