[pypy-svn] r42406 - pypy/dist/pypy/rlib/parsing
santagada at codespeak.net
santagada at codespeak.net
Sat Apr 28 20:12:45 CEST 2007
Author: santagada
Date: Sat Apr 28 20:12:44 2007
New Revision: 42406
Modified:
pypy/dist/pypy/rlib/parsing/ebnfparse.py
Log:
made a try/catch on py.option.view of generated ToAST
Modified: pypy/dist/pypy/rlib/parsing/ebnfparse.py
==============================================================================
--- pypy/dist/pypy/rlib/parsing/ebnfparse.py (original)
+++ pypy/dist/pypy/rlib/parsing/ebnfparse.py Sat Apr 28 20:12:44 2007
@@ -296,9 +296,14 @@
self.emit("r = self.visit_%s(tree)" % (startsymbol, ))
self.emit("assert len(r) == 1")
self.start_block("if not we_are_translated():")
+ self.start_block("try:")
self.start_block("if py.test.config.option.view:")
self.emit("r[0].view()")
self.end_block("option.view")
+ self.end_block("try")
+ self.start_block("except AttributeError:")
+ self.emit("pass")
+ self.end_block("except")
self.end_block("we_are_translated")
self.emit("return r[0]")
self.end_block("transform")
More information about the Pypy-commit
mailing list