diff options
author | Damien George <damien.p.george@gmail.com> | 2016-10-07 13:58:25 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2016-10-07 13:58:25 +1100 |
commit | a2bfcbe029a4c0d47efe5b1b51d4cd2c010f748d (patch) | |
tree | 6a07a359d88479e774b0df94545ec52a3feccfe8 /stmhal/moduselect.c | |
parent | e3d29996b3d0b1a81bd3dcc1d139e0a6ee233b03 (diff) | |
download | micropython-a2bfcbe029a4c0d47efe5b1b51d4cd2c010f748d.tar.gz micropython-a2bfcbe029a4c0d47efe5b1b51d4cd2c010f748d.zip |
stmhal: Use mp_raise_OSError helper function.
Diffstat (limited to 'stmhal/moduselect.c')
-rw-r--r-- | stmhal/moduselect.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/stmhal/moduselect.c b/stmhal/moduselect.c index 2dcac7fdec..0d76953c61 100644 --- a/stmhal/moduselect.c +++ b/stmhal/moduselect.c @@ -26,7 +26,7 @@ #include <stdio.h> -#include "py/nlr.h" +#include "py/runtime.h" #include "py/obj.h" #include "py/objlist.h" #include "py/mperrno.h" @@ -89,7 +89,7 @@ STATIC mp_uint_t poll_map_poll(mp_map_t *poll_map, mp_uint_t *rwx_num) { if (ret == -1) { // error doing ioctl - nlr_raise(mp_obj_new_exception_arg1(&mp_type_OSError, MP_OBJ_NEW_SMALL_INT(errcode))); + mp_raise_OSError(errcode); } if (ret != 0) { @@ -213,7 +213,7 @@ STATIC mp_obj_t poll_modify(mp_obj_t self_in, mp_obj_t obj_in, mp_obj_t eventmas mp_obj_poll_t *self = self_in; mp_map_elem_t *elem = mp_map_lookup(&self->poll_map, mp_obj_id(obj_in), MP_MAP_LOOKUP); if (elem == NULL) { - nlr_raise(mp_obj_new_exception_arg1(&mp_type_OSError, MP_OBJ_NEW_SMALL_INT(MP_ENOENT))); + mp_raise_OSError(MP_ENOENT); } ((poll_obj_t*)elem->value)->flags = mp_obj_get_int(eventmask_in); return mp_const_none; |