[pypy-svn] r66508 - in pypy/branch/parser-compiler/pypy/interpreter/astcompiler: . test

benjamin at codespeak.net benjamin at codespeak.net
Wed Jul 22 20:34:42 CEST 2009


Author: benjamin
Date: Wed Jul 22 20:34:42 2009
New Revision: 66508

Modified:
   pypy/branch/parser-compiler/pypy/interpreter/astcompiler/symtable.py
   pypy/branch/parser-compiler/pypy/interpreter/astcompiler/test/test_symtable.py
Log:
cpython error message

Modified: pypy/branch/parser-compiler/pypy/interpreter/astcompiler/symtable.py
==============================================================================
--- pypy/branch/parser-compiler/pypy/interpreter/astcompiler/symtable.py	(original)
+++ pypy/branch/parser-compiler/pypy/interpreter/astcompiler/symtable.py	Wed Jul 22 20:34:42 2009
@@ -199,15 +199,15 @@
 
     def note_yield(self, yield_node):
         if self.return_with_value:
-            raise SyntaxError("return with value in generator",
+            raise SyntaxError("'return' with argument in generator",
                               yield_node.lineno, yield_node.col_offset)
         self.is_generator = True
 
     def note_return(self, ret):
         if ret.value:
             if self.is_generator:
-                raise SyntaxError("return with value in generator", ret.lineno,
-                                  ret.col_offset)
+                raise SyntaxError("'return' with argument in generator",
+                                  ret.lineno, ret.col_offset)
             self.return_with_value = True
 
     def note_exec(self, exc):

Modified: pypy/branch/parser-compiler/pypy/interpreter/astcompiler/test/test_symtable.py
==============================================================================
--- pypy/branch/parser-compiler/pypy/interpreter/astcompiler/test/test_symtable.py	(original)
+++ pypy/branch/parser-compiler/pypy/interpreter/astcompiler/test/test_symtable.py	Wed Jul 22 20:34:42 2009
@@ -313,7 +313,7 @@
         for input in ("yield\n    return x", "return x\n    yield"):
             input = "def f():\n    " + input
             exc = py.test.raises(SyntaxError, self.func_scope, input).value
-            assert exc.msg == "return with value in generator"
+            assert exc.msg == "'return' with argument in generator"
         scp = self.func_scope("def f():\n    return\n    yield x")
 
     def test_return(self):



More information about the Pypy-commit mailing list