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/modio.c | |
parent | 0363e1d7b5b80046b49b07d8fbb739315474b4b9 (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/modio.c')
-rw-r--r-- | py/modio.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/py/modio.c b/py/modio.c index 2a38af602..d5da0b1db 100644 --- a/py/modio.c +++ b/py/modio.c @@ -102,7 +102,7 @@ STATIC mp_obj_t bufwriter_flush(mp_obj_t self_in) { assert(out_sz == self->len); self->len = 0; if (err != 0) { - nlr_raise(mp_obj_new_exception_arg1(&mp_type_OSError, MP_OBJ_NEW_SMALL_INT(err))); + mp_raise_OSError(err); } } |