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.
diff --git a/py/builtintables.c b/py/builtintables.c
index 7b35207..5712a3e 100644
--- a/py/builtintables.c
+++ b/py/builtintables.c
@@ -123,7 +123,6 @@
     { MP_OBJ_NEW_QSTR(MP_QSTR_EOFError), (mp_obj_t)&mp_type_EOFError },
     { MP_OBJ_NEW_QSTR(MP_QSTR_Exception), (mp_obj_t)&mp_type_Exception },
     { MP_OBJ_NEW_QSTR(MP_QSTR_GeneratorExit), (mp_obj_t)&mp_type_GeneratorExit },
-    { MP_OBJ_NEW_QSTR(MP_QSTR_IOError), (mp_obj_t)&mp_type_IOError },
     { MP_OBJ_NEW_QSTR(MP_QSTR_ImportError), (mp_obj_t)&mp_type_ImportError },
     { MP_OBJ_NEW_QSTR(MP_QSTR_IndentationError), (mp_obj_t)&mp_type_IndentationError },
     { MP_OBJ_NEW_QSTR(MP_QSTR_IndexError), (mp_obj_t)&mp_type_IndexError },
diff --git a/py/obj.h b/py/obj.h
index d96e4ec..0156286 100644
--- a/py/obj.h
+++ b/py/obj.h
@@ -326,7 +326,6 @@
 extern const mp_obj_type_t mp_type_EOFError;
 extern const mp_obj_type_t mp_type_Exception;
 extern const mp_obj_type_t mp_type_GeneratorExit;
-extern const mp_obj_type_t mp_type_IOError;
 extern const mp_obj_type_t mp_type_ImportError;
 extern const mp_obj_type_t mp_type_IndentationError;
 extern const mp_obj_type_t mp_type_IndexError;
diff --git a/py/objexcept.c b/py/objexcept.c
index 7f07365..9b22acd 100644
--- a/py/objexcept.c
+++ b/py/objexcept.c
@@ -224,10 +224,10 @@
   MP_DEFINE_EXCEPTION(AssertionError, Exception)
   MP_DEFINE_EXCEPTION(AttributeError, Exception)
   //MP_DEFINE_EXCEPTION(BufferError, Exception)
-  //MP_DEFINE_EXCEPTION(EnvironmentError, Exception)
+  //MP_DEFINE_EXCEPTION(EnvironmentError, Exception) use OSError instead
   MP_DEFINE_EXCEPTION(EOFError, Exception)
   MP_DEFINE_EXCEPTION(ImportError, Exception)
-  MP_DEFINE_EXCEPTION(IOError, Exception)
+  //MP_DEFINE_EXCEPTION(IOError, Exception) use OSError instead
   MP_DEFINE_EXCEPTION(LookupError, Exception)
     MP_DEFINE_EXCEPTION_BASE(LookupError)
     MP_DEFINE_EXCEPTION(IndexError, LookupError)
diff --git a/py/qstrdefs.h b/py/qstrdefs.h
index fda140f..6a63f07 100644
--- a/py/qstrdefs.h
+++ b/py/qstrdefs.h
@@ -105,7 +105,6 @@
 Q(FileNotFoundError)
 Q(FloatingPointError)
 Q(GeneratorExit)
-Q(IOError)
 Q(ImportError)
 Q(IndentationError)
 Q(IndexError)
diff --git a/stmhal/modselect.c b/stmhal/modselect.c
index a84c945..ff9df8f 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 @@
     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;
diff --git a/tests/basics/exceptpoly.py b/tests/basics/exceptpoly.py
index 599a72b..2dc68c1 100644
--- a/tests/basics/exceptpoly.py
+++ b/tests/basics/exceptpoly.py
@@ -108,15 +108,15 @@
 #except FutureWarning:
 #    print("Caught FutureWarning")
 
-try:
-    raise IOError
-except Exception:
-    print("Caught IOError via Exception")
+#try:
+#    raise IOError
+#except Exception:
+#    print("Caught IOError via Exception")
 
-try:
-    raise IOError
-except IOError:
-    print("Caught IOError")
+#try:
+#    raise IOError
+#except IOError:
+#    print("Caught IOError")
 
 try:
     raise ImportError