From ab7f482b4d359c2b71727bc1c7691657be05a791 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Thu, 30 Apr 2009 18:23:32 +0200 Subject: [PATCH] don't loose outer closure scope while we still need it --- Cython/Compiler/Nodes.py | 2 ++ 1 file changed, 2 insertions(+) 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 -- 2.26.2