all: Make more use of mp_raise_{msg,TypeError,ValueError} helpers.

This commit is contained in:
Damien George
2017-06-15 11:54:41 +10:00
parent 1e70fda69f
commit 48d867b4a6
17 changed files with 33 additions and 37 deletions

View File

@@ -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_msg(&mp_type_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_msg(&mp_type_IndexError, "string index out of range");
}
// Then check completion
if (i-- == 0) {