summaryrefslogtreecommitdiff
path: root/py/objstrunicode.c
diff options
context:
space:
mode:
authorJeff Epler <jeff@adafruit.com>2020-08-07 10:06:39 -0500
committerGitHub <noreply@github.com>2020-08-07 10:06:39 -0500
commitd8cc4795be4d327be980f02f3be5f90d625bd286 (patch)
treeb402e17e4f4909b58b5bf4797f80d1b022f205f1 /py/objstrunicode.c
parent16170d44abc55d8a5e65b903fa3e200c0154cbc1 (diff)
parent93b373d617ff7a99eb936628d50d954f5db53f43 (diff)
Merge pull request #3236 from jepler/firmware-size-gemma-trinket
Firmware size savings
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) {