From 5ef1b0a5d0d5d3a0f000af7f268aaa4bcfc31ad6 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Tue, 25 May 2010 08:51:35 +0200 Subject: [PATCH] revert comprehensions to their previous (var-leaking) behaviour --- Cython/Compiler/ExprNodes.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index 954fccda..d1561447 100755 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -3920,7 +3920,7 @@ class ScopedExprNode(ExprNode): pass -class ComprehensionNode(ScopedExprNode): +class ComprehensionNode(ExprNode): # (ScopedExprNode) subexprs = ["target"] child_attrs = ["loop", "append"] @@ -3929,16 +3929,18 @@ class ComprehensionNode(ScopedExprNode): def analyse_declarations(self, env): self.append.target = self # this is used in the PyList_Append of the inner loop - self.expr_scope = Symtab.GeneratorExpressionScope(env) - self.loop.analyse_declarations(self.expr_scope) + self.loop.analyse_declarations(env) +# self.expr_scope = Symtab.GeneratorExpressionScope(env) +# self.loop.analyse_declarations(self.expr_scope) def analyse_types(self, env): self.target.analyse_expressions(env) self.type = self.target.type - - def analyse_scoped_expressions(self, env): self.loop.analyse_expressions(env) +# def analyse_scoped_expressions(self, env): +# self.loop.analyse_expressions(env) + def may_be_none(self): return False -- 2.26.2