[pypy-svn] r66436 - in pypy/branch/parser-compiler/pypy/interpreter: astcompiler/test pyparser pyparser/test

benjamin at codespeak.net benjamin at codespeak.net
Mon Jul 20 16:26:03 CEST 2009


Author: benjamin
Date: Mon Jul 20 16:26:02 2009
New Revision: 66436

Modified:
   pypy/branch/parser-compiler/pypy/interpreter/astcompiler/test/test_compiler.py
   pypy/branch/parser-compiler/pypy/interpreter/pyparser/pyparse.py
   pypy/branch/parser-compiler/pypy/interpreter/pyparser/test/test_pyparse.py
Log:
use cpython's error message

Modified: pypy/branch/parser-compiler/pypy/interpreter/astcompiler/test/test_compiler.py
==============================================================================
--- pypy/branch/parser-compiler/pypy/interpreter/astcompiler/test/test_compiler.py	(original)
+++ pypy/branch/parser-compiler/pypy/interpreter/astcompiler/test/test_compiler.py	Mon Jul 20 16:26:02 2009
@@ -672,7 +672,7 @@
         try:
             self.simple_test(source, None, None)
         except IndentationError, e:
-            assert e.msg == 'expected indented block'
+            assert e.msg == 'expected an indented block'
         else:
             raise Exception("DID NOT RAISE")
 

Modified: pypy/branch/parser-compiler/pypy/interpreter/pyparser/pyparse.py
==============================================================================
--- pypy/branch/parser-compiler/pypy/interpreter/pyparser/pyparse.py	(original)
+++ pypy/branch/parser-compiler/pypy/interpreter/pyparser/pyparse.py	Mon Jul 20 16:26:02 2009
@@ -130,7 +130,7 @@
             if tp == pygram.tokens.INDENT:
                 msg = "unexpected indent"
             elif e.expected == pygram.tokens.INDENT:
-                msg = "expected indented block"
+                msg = "expected an indented block"
             else:
                 new_err = error.SyntaxError
                 msg = "invalid syntax"

Modified: pypy/branch/parser-compiler/pypy/interpreter/pyparser/test/test_pyparse.py
==============================================================================
--- pypy/branch/parser-compiler/pypy/interpreter/pyparser/test/test_pyparse.py	(original)
+++ pypy/branch/parser-compiler/pypy/interpreter/pyparser/test/test_pyparse.py	Mon Jul 20 16:26:02 2009
@@ -81,7 +81,7 @@
 def f():
 pass"""
         exc = py.test.raises(IndentationError, parse, input).value
-        assert exc.msg == "expected indented block"
+        assert exc.msg == "expected an indented block"
         assert exc.lineno == 3
         assert exc.text.startswith("pass")
         assert exc.offset == 4



More information about the Pypy-commit mailing list