diff options
| author | DavePutz <dwputz@gmail.com> | 2020-09-14 16:50:40 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-14 16:50:40 -0500 |
| commit | 2a2a8d64571bf93e2a166626841555fe1753a565 (patch) | |
| tree | a4b7ba795a6e17d4d0b32abd942af380b1c36e57 /py/objstrunicode.c | |
| parent | 4a3be4df91837a1c71fcbd62e041f7c45cd4dd4b (diff) | |
| parent | 3d8bac50e41acc286cefbde9e052c5ccb335101e (diff) | |
Merge pull request #28 from adafruit/main
Merge from adafruit/main
Diffstat (limited to 'py/objstrunicode.c')
| -rw-r--r-- | py/objstrunicode.c | 6 |
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) { |
