[pypy-svn] r16582 - in pypy/dist/pypy: interpreter/stablecompiler lib/_stablecompiler

ludal at codespeak.net ludal at codespeak.net
Fri Aug 26 11:57:14 CEST 2005


Author: ludal
Date: Fri Aug 26 11:57:11 2005
New Revision: 16582

Modified:
   pypy/dist/pypy/interpreter/stablecompiler/transformer.py
   pypy/dist/pypy/lib/_stablecompiler/transformer.py
Log:
 - report error when assigning to genexp


Modified: pypy/dist/pypy/interpreter/stablecompiler/transformer.py
==============================================================================
--- pypy/dist/pypy/interpreter/stablecompiler/transformer.py	(original)
+++ pypy/dist/pypy/interpreter/stablecompiler/transformer.py	Fri Aug 26 11:57:11 2005
@@ -984,6 +984,9 @@
 
     def com_assign_tuple(self, node, assigning):
         assigns = []
+        if len(node)>=3:
+            if node[2][0] == symbol.gen_for:
+                raise SyntaxError("assign to generator expression not possible")
         for i in range(1, len(node), 2):
             assigns.append(self.com_assign(node[i], assigning))
         return AssTuple(assigns, lineno=extractLineNo(node))

Modified: pypy/dist/pypy/lib/_stablecompiler/transformer.py
==============================================================================
--- pypy/dist/pypy/lib/_stablecompiler/transformer.py	(original)
+++ pypy/dist/pypy/lib/_stablecompiler/transformer.py	Fri Aug 26 11:57:11 2005
@@ -981,6 +981,9 @@
 
     def com_assign_tuple(self, node, assigning):
         assigns = []
+        if len(node)>=3:
+            if node[2][0] == symbol.gen_for:
+                raise SyntaxError("assign to generator expression not possible")
         for i in range(1, len(node), 2):
             assigns.append(self.com_assign(node[i], assigning))
         return AssTuple(assigns, lineno=extractLineNo(node))



More information about the Pypy-commit mailing list