all: Make more use of mp_raise_{msg,TypeError,ValueError} helpers.
This commit is contained in:
3
py/obj.c
3
py/obj.c
@@ -460,8 +460,7 @@ mp_obj_t mp_obj_subscr(mp_obj_t base, mp_obj_t index, mp_obj_t value) {
|
||||
}
|
||||
} else if (value == MP_OBJ_SENTINEL) {
|
||||
if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) {
|
||||
nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_TypeError,
|
||||
"object is not subscriptable"));
|
||||
mp_raise_TypeError("object is not subscriptable");
|
||||
} else {
|
||||
nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_TypeError,
|
||||
"'%s' object is not subscriptable", mp_obj_get_type_str(base)));
|
||||
|
||||
Reference in New Issue
Block a user