aboutsummaryrefslogtreecommitdiff
path: root/py/modthread.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2016-10-07 13:31:59 +1100
committerDamien George <damien.p.george@gmail.com>2016-10-07 13:31:59 +1100
commit3a0a7717304cc34a4d6ef55f767666c918c185b5 (patch)
tree1fe4bf5605c62004fe24b6233c95ca02d870c37d /py/modthread.c
parent0363e1d7b5b80046b49b07d8fbb739315474b4b9 (diff)
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.
Diffstat (limited to 'py/modthread.c')
-rw-r--r--py/modthread.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/py/modthread.c b/py/modthread.c
index 24b94f1c8..c358cdf9e 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
}