use a standard error message

This commit is contained in:
Jeff Epler 2022-11-08 15:37:57 -06:00
parent d39d146352
commit a94663b3c9
No known key found for this signature in database
GPG Key ID: D5BF15AB975AB4DE

View File

@ -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) {