From 3a0a7717304cc34a4d6ef55f767666c918c185b5 Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 7 Oct 2016 13:31:59 +1100 Subject: py: Add mp_raise_OSError(errno) helper function. This is an often used code pattern, and its use reduces code size of the core by about 100 bytes. --- py/modthread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'py/modthread.c') diff --git a/py/modthread.c b/py/modthread.c index 24b94f1c84..c358cdf9ed 100644 --- a/py/modthread.c +++ b/py/modthread.c @@ -93,7 +93,7 @@ STATIC mp_obj_t thread_lock_acquire(size_t n_args, const mp_obj_t *args) { self->locked = true; return mp_const_true; } else { - nlr_raise(mp_obj_new_exception_arg1(&mp_type_OSError, MP_OBJ_NEW_SMALL_INT(-ret))); + mp_raise_OSError(-ret); } #endif } -- cgit v1.2.3