Replace IOError with OSError (#16715)
diff --git a/Lib/lib2to3/pgen2/driver.py b/Lib/lib2to3/pgen2/driver.py
index 4c611c6..3ccc69d 100644
--- a/Lib/lib2to3/pgen2/driver.py
+++ b/Lib/lib2to3/pgen2/driver.py
@@ -123,7 +123,7 @@
             logger.info("Writing grammar tables to %s", gp)
             try:
                 g.dump(gp)
-            except IOError as e:
+            except OSError as e:
                 logger.info("Writing failed:"+str(e))
     else:
         g = grammar.Grammar()