all: Make more use of mp_raise_{msg,TypeError,ValueError} helpers.
This commit is contained in:
@@ -398,8 +398,7 @@ STATIC mp_obj_t mp_builtin_ord(mp_obj_t o_in) {
|
||||
#endif
|
||||
|
||||
if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) {
|
||||
nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_TypeError,
|
||||
"ord expects a character"));
|
||||
mp_raise_TypeError("ord expects a character");
|
||||
} else {
|
||||
nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_TypeError,
|
||||
"ord() expected a character, but string of length %d found", (int)len));
|
||||
|
||||
Reference in New Issue
Block a user