diff options
author | Damien George <damien.p.george@gmail.com> | 2016-10-07 13:31:59 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2016-10-07 13:31:59 +1100 |
commit | 3a0a7717304cc34a4d6ef55f767666c918c185b5 (patch) | |
tree | 1fe4bf5605c62004fe24b6233c95ca02d870c37d /py/modthread.c | |
parent | 0363e1d7b5b80046b49b07d8fbb739315474b4b9 (diff) | |
download | micropython-3a0a7717304cc34a4d6ef55f767666c918c185b5.tar.gz micropython-3a0a7717304cc34a4d6ef55f767666c918c185b5.zip |
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.c | 2 |
1 files changed, 1 insertions, 1 deletions
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 } |