Replace IOError with OSError (#16715)
diff --git a/Lib/test/test_ioctl.py b/Lib/test/test_ioctl.py
index 531c9af..7eb324a 100644
--- a/Lib/test/test_ioctl.py
+++ b/Lib/test/test_ioctl.py
@@ -8,7 +8,7 @@
 
 try:
     tty = open("/dev/tty", "rb")
-except IOError:
+except OSError:
     raise unittest.SkipTest("Unable to open /dev/tty")
 else:
     # Skip if another process is in foreground