summaryrefslogtreecommitdiff
path: root/py/runtime.c
diff options
context:
space:
mode:
Diffstat (limited to 'py/runtime.c')
-rw-r--r--py/runtime.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/py/runtime.c b/py/runtime.c
index 91ead1fba..c0a4f44a1 100644
--- a/py/runtime.c
+++ b/py/runtime.c
@@ -1546,6 +1546,14 @@ NORETURN void mp_raise_IndexError(const compressed_string_t *msg) {
mp_raise_msg(&mp_type_IndexError, msg);
}
+NORETURN void mp_raise_IndexError_varg(const compressed_string_t *fmt, ...) {
+ va_list argptr;
+ va_start(argptr,fmt);
+ mp_obj_t exception = mp_obj_new_exception_msg_vlist(&mp_type_IndexError, fmt, argptr);
+ va_end(argptr);
+ nlr_raise(exception);
+}
+
NORETURN void mp_raise_ValueError(const compressed_string_t *msg) {
mp_raise_msg(&mp_type_ValueError, msg);
}