[pypy-svn] r71997 - pypy/release/1.2.x/pypy/module/parser

arigo at codespeak.net arigo at codespeak.net
Tue Mar 9 20:00:14 CET 2010


Author: arigo
Date: Tue Mar  9 20:00:13 2010
New Revision: 71997

Modified:
   pypy/release/1.2.x/pypy/module/parser/pyparser.py
Log:
svn merge svn+ssh://codespeak.net/svn/pypy/trunk -r71995:71996


Modified: pypy/release/1.2.x/pypy/module/parser/pyparser.py
==============================================================================
--- pypy/release/1.2.x/pypy/module/parser/pyparser.py	(original)
+++ pypy/release/1.2.x/pypy/module/parser/pyparser.py	Tue Mar  9 20:00:13 2010
@@ -55,7 +55,15 @@
     def descr_compile(self, space, filename="<syntax-tree>"):
         info = pyparse.CompileInfo(filename, self.mode)
         ast = ast_from_node(space, self.tree, info)
-        return space.wrap(compile_ast(space, ast, info))
+        try:
+            result = compile_ast(space, ast, info)
+        except error.IndentationError, e:
+            raise OperationError(space.w_IndentationError,
+                                 e.wrap_info(space))
+        except error.SyntaxError, e:
+            raise OperationError(space.w_SyntaxError,
+                                 e.wrap_info(space))
+        return space.wrap(result)
     descr_compile.unwrap_spec = ["self", ObjSpace, str]
 
 STType.typedef = TypeDef("parser.st",



More information about the Pypy-commit mailing list