diff options
author | Damien George <damien.p.george@gmail.com> | 2014-09-30 13:59:30 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-09-30 13:59:30 +0000 |
commit | 8b03d944e2ae64f7987116ff342fbd1cc3b97b71 (patch) | |
tree | cf97eaa8ef616e44c6703535b42b73de7650c1f0 /stmhal/modselect.c | |
parent | 1c6a1dc740a8414be6c9b1101354fe9a8974ff13 (diff) | |
download | micropython-8b03d944e2ae64f7987116ff342fbd1cc3b97b71.tar.gz micropython-8b03d944e2ae64f7987116ff342fbd1cc3b97b71.zip |
py: Remove IOError since it's deprecated; use OSError instead.
In CPython IOError (and EnvironmentError) is deprecated and aliased to
OSError. All modules that used to raise IOError now raise OSError (or a
derived exception).
In Micro Python we never used IOError (except 1 place, incorrectly) and
so don't need to keep it.
See http://legacy.python.org/dev/peps/pep-3151/ for background.
Diffstat (limited to 'stmhal/modselect.c')
-rw-r--r-- | stmhal/modselect.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/stmhal/modselect.c b/stmhal/modselect.c index a84c94554c..ff9df8f5ec 100644 --- a/stmhal/modselect.c +++ b/stmhal/modselect.c @@ -26,6 +26,7 @@ #include <stdint.h> #include <stdio.h> +#include <errno.h> #include "stm32f4xx_hal.h" @@ -213,7 +214,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_msg(&mp_type_IOError, "object was never registered")); + nlr_raise(mp_obj_new_exception_arg1(&mp_type_OSError, MP_OBJ_NEW_SMALL_INT(ENOENT))); } ((poll_obj_t*)elem->value)->flags = mp_obj_get_int(eventmask_in); return mp_const_none; |