Replace IOError with OSError (#16715)
diff --git a/Lib/pstats.py b/Lib/pstats.py
index 6a77605..7cf000f 100644
--- a/Lib/pstats.py
+++ b/Lib/pstats.py
@@ -612,7 +612,7 @@
             if line:
                 try:
                     self.stats = Stats(line)
-                except IOError as err:
+                except OSError as err:
                     print(err.args[1], file=self.stream)
                     return
                 except Exception as err: