#18151, part 1: Backport idlelilb portion of Andrew Svetlov's 3.4 patch
changing IOError to OSError (#16715).
diff --git a/Lib/idlelib/IOBinding.py b/Lib/idlelib/IOBinding.py
index 9fe0701..37a11ad 100644
--- a/Lib/idlelib/IOBinding.py
+++ b/Lib/idlelib/IOBinding.py
@@ -213,7 +213,7 @@
             f.seek(0)
             bytes = f.read()
             f.close()
-        except IOError as msg:
+        except OSError as msg:
             tkMessageBox.showerror("I/O Error", str(msg), master=self.text)
             return False
         chars, converted = self._decode(two_lines, bytes)
@@ -378,7 +378,7 @@
             f.flush()
             f.close()
             return True
-        except IOError as msg:
+        except OSError as msg:
             tkMessageBox.showerror("I/O Error", str(msg),
                                    master=self.text)
             return False