[Python-checkins] r63643 - sandbox/trunk/2to3/lib2to3/pgen2/driver.py

martin.v.loewis python-checkins at python.org
Sun May 25 19:18:22 CEST 2008


Author: martin.v.loewis
Date: Sun May 25 19:18:21 2008
New Revision: 63643

Log:
Don't abort on IOErrors caused by saving pickle files.
Fixes #2938.


Modified:
   sandbox/trunk/2to3/lib2to3/pgen2/driver.py

Modified: sandbox/trunk/2to3/lib2to3/pgen2/driver.py
==============================================================================
--- sandbox/trunk/2to3/lib2to3/pgen2/driver.py	(original)
+++ sandbox/trunk/2to3/lib2to3/pgen2/driver.py	Sun May 25 19:18:21 2008
@@ -126,7 +126,10 @@
         g = pgen.generate_grammar(gt)
         if save:
             logger.info("Writing grammar tables to %s", gp)
-            g.dump(gp)
+            try:
+                g.dump(gp)
+            except IOError, e:
+                logger.info("Writing failed:"+str(e))
     else:
         g = grammar.Grammar()
         g.load(gp)


More information about the Python-checkins mailing list