[pypy-svn] r66510 - pypy/branch/parser-compiler/pypy/interpreter/astcompiler
benjamin at codespeak.net
benjamin at codespeak.net
Wed Jul 22 20:52:15 CEST 2009
Author: benjamin
Date: Wed Jul 22 20:52:14 2009
New Revision: 66510
Modified:
pypy/branch/parser-compiler/pypy/interpreter/astcompiler/symtable.py
Log:
always error out on the yield node
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:52:14 2009
@@ -201,13 +201,15 @@
if self.return_with_value:
raise SyntaxError("'return' with argument inside generator",
yield_node.lineno, yield_node.col_offset)
+ self.yie_node = yield_node
self.is_generator = True
def note_return(self, ret):
if ret.value:
if self.is_generator:
raise SyntaxError("'return' with argument in generator",
- ret.lineno, ret.col_offset)
+ self.yie_node.lineno,
+ self.yie_node.col_offset)
self.return_with_value = True
def note_exec(self, exc):
More information about the Pypy-commit
mailing list