From: Stefan Behnel Date: Thu, 30 Apr 2009 16:23:32 +0000 (+0200) Subject: don't loose outer closure scope while we still need it X-Git-Tag: 0.13.beta0~2^2~143 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ab7f482b4d359c2b71727bc1c7691657be05a791;p=cython.git don't loose outer closure scope while we still need it --- diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index 0f784d81..a43e5168 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -1069,6 +1069,8 @@ class FuncDefNode(StatNode, BlockNode): outer_scope_cname, env.scope_class.type.declaration_code(''), Naming.self_cname)) + code.put_incref(outer_scope_cname, py_object_type) + code.put_giveref(outer_scope_cname) # ----- Fetch arguments self.generate_argument_parsing_code(env, code) # If an argument is assigned to in the body, we must