diff options
| author | Benjamin Shockley <benjaminshockley@hotmail.com> | 2021-01-03 10:41:16 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-03 10:41:16 -0600 |
| commit | 8c8961ad0142a20793910363c8182c847b47bc58 (patch) | |
| tree | 986358982921ccb6e887b0f0f5af39ec67709990 /py/objstrunicode.c | |
| parent | 0084f0af24e4e219bc040c52ee723959423de6e2 (diff) | |
| parent | 80fa60d4ef6a054cc481318caba96ef8d77fc026 (diff) | |
Merge pull request #3 from adafruit/main
Rebase
Diffstat (limited to 'py/objstrunicode.c')
| -rw-r--r-- | py/objstrunicode.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/py/objstrunicode.c b/py/objstrunicode.c index 30000a51e..50250abfa 100644 --- a/py/objstrunicode.c +++ b/py/objstrunicode.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George * Copyright (c) 2014 Paul Sokolovsky * * Permission is hereby granted, free of charge, to any person obtaining a copy @@ -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) { |
