Merged revisions 63644 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/trunk

................
  r63644 | martin.v.loewis | 2008-05-25 19:19:22 +0200 (So, 25 Mai 2008) | 10 lines

  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:22:03 +00:00
parent be02395ef9
commit 346c92195c
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)
if save:
logger.info("Writing grammar tables to %s", gp)
g.dump(gp)
try:
g.dump(gp)
except IOError as e:
logger.info("Writing failed:"+str(e))
else:
g = grammar.Grammar()
g.load(gp)