Replace IOError with OSError (#16715)
diff --git a/Lib/test/test_resource.py b/Lib/test/test_resource.py
index 3c9b620..0240c69 100644
--- a/Lib/test/test_resource.py
+++ b/Lib/test/test_resource.py
@@ -61,7 +61,7 @@
                         for i in range(5):
                             time.sleep(.1)
                             f.flush()
-                    except IOError:
+                    except OSError:
                         if not limit_set:
                             raise
                     if limit_set: