diff options
author | Jim Mussared <jim.mussared@gmail.com> | 2020-03-02 22:35:22 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2020-04-05 15:02:06 +1000 |
commit | def76fe4d9bbc2c342594dc05861b24d7165d274 (patch) | |
tree | d04ad778e2421de0a85835227ba5bcb08562ec24 /py/objstrunicode.c | |
parent | 85858e72dfdc3e941c2e620e94de05ad663138b1 (diff) |
all: Use MP_ERROR_TEXT for all error messages.
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 defcbe4ce..b21df22a3 100644 --- a/py/objstrunicode.c +++ b/py/objstrunicode.c @@ -129,7 +129,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_msg_varg(&mp_type_TypeError, "string indices must be integers, not %s", mp_obj_get_type_str(index)); + mp_raise_msg_varg(&mp_type_TypeError, MP_ERROR_TEXT("string indices must be integers, not %s"), mp_obj_get_type_str(index)); } const byte *s, *top = self_data + self_len; if (i < 0) { @@ -139,7 +139,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_msg(&mp_type_IndexError, "string index out of range"); + mp_raise_msg(&mp_type_IndexError, MP_ERROR_TEXT("string index out of range")); } if (!UTF8_IS_CONT(*s)) { ++i; @@ -158,7 +158,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_msg(&mp_type_IndexError, "string index out of range"); + mp_raise_msg(&mp_type_IndexError, MP_ERROR_TEXT("string index out of range")); } // Then check completion if (i-- == 0) { @@ -189,7 +189,7 @@ STATIC mp_obj_t str_subscr(mp_obj_t self_in, mp_obj_t index, mp_obj_t value) { ostep = slice->step; if (ostep != mp_const_none && ostep != MP_OBJ_NEW_SMALL_INT(1)) { - mp_raise_NotImplementedError("only slices with step=1 (aka None) are supported"); + mp_raise_NotImplementedError(MP_ERROR_TEXT("only slices with step=1 (aka None) are supported")); } const byte *pstart, *pstop; |