Author: Antonio Cuni <[email protected]>
Branch: py3k
Changeset: r57393:525b21072c09
Date: 2012-09-19 17:04 +0200
http://bitbucket.org/pypy/pypy/changeset/525b21072c09/

Log:    convert the interp level TabError into an applevel one

diff --git a/pypy/interpreter/pycompiler.py b/pypy/interpreter/pycompiler.py
--- a/pypy/interpreter/pycompiler.py
+++ b/pypy/interpreter/pycompiler.py
@@ -145,6 +145,9 @@
         try:
             parse_tree = self.parser.parse_source(source, info)
             mod = astbuilder.ast_from_node(space, parse_tree, info)
+        except parseerror.TabError, e:
+            raise OperationError(space.w_TabError,
+                                 e.wrap_info(space))
         except parseerror.IndentationError, e:
             raise OperationError(space.w_IndentationError,
                                  e.wrap_info(space))
diff --git a/pypy/interpreter/test/test_compiler.py 
b/pypy/interpreter/test/test_compiler.py
--- a/pypy/interpreter/test/test_compiler.py
+++ b/pypy/interpreter/test/test_compiler.py
@@ -992,6 +992,17 @@
         else:
             raise Exception("DID NOT RAISE")
 
+    def test_taberror(self):
+        source = """if 1:
+        x
+    \ty
+        """
+        try:
+            exec(source)
+        except TabError as e:
+            pass
+        else:
+            raise Exception("DID NOT RAISE")
 
     def test_repr_vs_str(self):
         source1 = "x = (\n"
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to