use instance for verbose errors

This commit is contained in:
Roy Hooper 2019-11-16 14:04:12 -05:00
parent 2970680e6a
commit fa57de0688
1 changed files with 3 additions and 3 deletions

View File

@ -508,21 +508,21 @@ mp_obj_t mp_obj_subscr(mp_obj_t base, mp_obj_t index, mp_obj_t value) {
mp_raise_TypeError(translate("object does not support item deletion"));
} else {
mp_raise_TypeError_varg(
translate("'%s' object does not support item deletion"), mp_obj_get_type_str(base));
translate("'%s' object does not support item deletion"), mp_obj_get_type_str(instance));
}
} else if (value == MP_OBJ_SENTINEL) {
if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) {
mp_raise_TypeError(translate("object is not subscriptable"));
} else {
mp_raise_TypeError_varg(
translate("'%s' object is not subscriptable"), mp_obj_get_type_str(base));
translate("'%s' object is not subscriptable"), mp_obj_get_type_str(instance));
}
} else {
if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) {
mp_raise_TypeError(translate("object does not support item assignment"));
} else {
mp_raise_TypeError_varg(
translate("'%s' object does not support item assignment"), mp_obj_get_type_str(base));
translate("'%s' object does not support item assignment"), mp_obj_get_type_str(instance));
}
}
}