use a standard error message
This commit is contained in:
parent
d39d146352
commit
a94663b3c9
@ -159,7 +159,7 @@ const byte *str_index_to_ptr(const mp_obj_type_t *type, const byte *self_data, s
|
|||||||
if (mp_obj_is_small_int(index)) {
|
if (mp_obj_is_small_int(index)) {
|
||||||
i = MP_OBJ_SMALL_INT_VALUE(index);
|
i = MP_OBJ_SMALL_INT_VALUE(index);
|
||||||
} else if (!mp_obj_get_int_maybe(index, &i)) {
|
} else if (!mp_obj_get_int_maybe(index, &i)) {
|
||||||
mp_raise_TypeError_varg(MP_ERROR_TEXT("string indices must be integers, not %q"), mp_obj_get_type_qstr(index));
|
mp_raise_TypeError_varg(translate("%q must be of type %q"), MP_QSTR_index, MP_QSTR_int);
|
||||||
}
|
}
|
||||||
const byte *s, *top = self_data + self_len;
|
const byte *s, *top = self_data + self_len;
|
||||||
if (i < 0) {
|
if (i < 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user