[pypy-svn] r60929 - pypy/trunk/pypy/interpreter/pyparser

antocuni at codespeak.net antocuni at codespeak.net
Tue Jan 13 17:35:16 CET 2009


Author: antocuni
Date: Tue Jan 13 17:35:16 2009
New Revision: 60929

Modified:
   pypy/trunk/pypy/interpreter/pyparser/asthelper.py
Log:
use a more precise error message for cases like "x = yield = y". This should fix some doctest errors in test_generators.py




Modified: pypy/trunk/pypy/interpreter/pyparser/asthelper.py
==============================================================================
--- pypy/trunk/pypy/interpreter/pyparser/asthelper.py	(original)
+++ pypy/trunk/pypy/interpreter/pyparser/asthelper.py	Tue Jan 13 17:35:16 2009
@@ -396,6 +396,9 @@
             else:
                 raise SyntaxError("can't assign to function call",
                                  lineno)
+        elif isinstance(ast_node, ast.Yield):
+            raise SyntaxError("assignment to yield expression not possible",
+                              lineno)
         else:
             raise SyntaxError("can't assign to non-lvalue",
                              lineno)



More information about the Pypy-commit mailing list