Merged revisions 63634-63643 via svnmerge from

svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3

........
  r63643 | martin.v.loewis | 2008-05-25 19:18:21 +0200 (So, 25 Mai 2008) | 3 lines

  Don't abort on IOErrors caused by saving pickle files.
  Fixes #2938.
........
This commit is contained in:
Martin v. Löwis 2008-05-25 17:19:22 +00:00
parent 367c79a4ad
commit bbaa2ebd17
1 changed files with 4 additions and 1 deletions

View File

@ -126,7 +126,10 @@ def load_grammar(gt="Grammar.txt", gp=None,
g = pgen.generate_grammar(gt) g = pgen.generate_grammar(gt)
if save: if save:
logger.info("Writing grammar tables to %s", gp) logger.info("Writing grammar tables to %s", gp)
try:
g.dump(gp) g.dump(gp)
except IOError, e:
logger.info("Writing failed:"+str(e))
else: else:
g = grammar.Grammar() g = grammar.Grammar()
g.load(gp) g.load(gp)