summaryrefslogtreecommitdiff
path: root/py/objstrunicode.c
diff options
context:
space:
mode:
authorJeff Epler <jepler@gmail.com>2020-08-10 12:54:12 -0500
committerJeff Epler <jepler@gmail.com>2020-08-10 12:54:12 -0500
commit1cf37623920a7da93f454c8b23f761ad2c4c54db (patch)
tree5aef9a2a6ee1c306f639427cb6816d3eb129527e /py/objstrunicode.c
parent0e2d231445d26c0aa104fc834133cb096d1f2303 (diff)
parentce911c5f5057cf72509ed9e704b46a66423b95d6 (diff)
Merge remote-tracking branch 'origin/main' into stm32-sdioio
Diffstat (limited to 'py/objstrunicode.c')
-rw-r--r--py/objstrunicode.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/py/objstrunicode.c b/py/objstrunicode.c
index 351a67e91..50250abfa 100644
--- a/py/objstrunicode.c
+++ b/py/objstrunicode.c
@@ -151,7 +151,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)) {
i = MP_OBJ_SMALL_INT_VALUE(index);
} else if (!mp_obj_get_int_maybe(index, &i)) {
- mp_raise_TypeError_varg(translate("string indices must be integers, not %s"), mp_obj_get_type_str(index));
+ mp_raise_TypeError_varg(translate("string indices must be integers, not %q"), mp_obj_get_type_qstr(index));
}
const byte *s, *top = self_data + self_len;
if (i < 0)
@@ -162,7 +162,7 @@ const byte *str_index_to_ptr(const mp_obj_type_t *type, const byte *self_data, s
if (is_slice) {
return self_data;
}
- mp_raise_IndexError(translate("string index out of range"));
+ mp_raise_IndexError_varg(translate("%q index out of range"), MP_QSTR_str);
}
if (!UTF8_IS_CONT(*s)) {
++i;
@@ -181,7 +181,7 @@ const byte *str_index_to_ptr(const mp_obj_type_t *type, const byte *self_data, s
if (is_slice) {
return top;
}
- mp_raise_IndexError(translate("string index out of range"));
+ mp_raise_IndexError_varg(translate("%q index out of range"), MP_QSTR_str);
}
// Then check completion
if (i-- == 0) {