From 48d867b4a68e53901aac87c2ff0f2a7e65f735c7 Mon Sep 17 00:00:00 2001 From: Damien George Date: Thu, 15 Jun 2017 11:54:41 +1000 Subject: all: Make more use of mp_raise_{msg,TypeError,ValueError} helpers. --- py/objstrunicode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'py/objstrunicode.c') diff --git a/py/objstrunicode.c b/py/objstrunicode.c index 9a6ce9b9a..d53428586 100644 --- a/py/objstrunicode.c +++ b/py/objstrunicode.c @@ -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) { -- cgit v1.2.3