summaryrefslogtreecommitdiff
path: root/py/objstrunicode.c
diff options
context:
space:
mode:
Diffstat (limited to 'py/objstrunicode.c')
-rw-r--r--py/objstrunicode.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/py/objstrunicode.c b/py/objstrunicode.c
index 8444a2689..b12c68e61 100644
--- a/py/objstrunicode.c
+++ b/py/objstrunicode.c
@@ -131,7 +131,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)) {
- nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_TypeError, "string indices must be integers, not %s", mp_obj_get_type_str(index)));
+ mp_raise_TypeError_varg("string indices must be integers, not %s", mp_obj_get_type_str(index));
}
const byte *s, *top = self_data + self_len;
if (i < 0)
@@ -142,7 +142,7 @@ const byte *str_index_to_ptr(const mp_obj_type_t *type, const byte *self_data, s
if (is_slice) {
return self_data;
}
- nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_IndexError, "string index out of range"));
+ mp_raise_IndexError("string index out of range");
}
if (!UTF8_IS_CONT(*s)) {
++i;
@@ -161,7 +161,7 @@ const byte *str_index_to_ptr(const mp_obj_type_t *type, const byte *self_data, s
if (is_slice) {
return top;
}
- nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_IndexError, "string index out of range"));
+ mp_raise_IndexError("string index out of range");
}
// Then check completion
if (i-- == 0) {
@@ -188,7 +188,7 @@ STATIC mp_obj_t str_subscr(mp_obj_t self_in, mp_obj_t index, mp_obj_t value) {
mp_obj_t ostart, ostop, ostep;
mp_obj_slice_get(index, &ostart, &ostop, &ostep);
if (ostep != mp_const_none && ostep != MP_OBJ_NEW_SMALL_INT(1)) {
- mp_not_implemented("only slices with step=1 (aka None) are supported");
+ mp_raise_NotImplementError("only slices with step=1 (aka None) are supported");
}
const byte *pstart, *pstop;