From: Vitja Makarov Date: Fri, 1 Apr 2011 14:10:11 +0000 (+0200) Subject: Fix refnanny context warning when in nogil mode X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2a9ed74644e1861cdd5e6ddcca9a167fa84c34c6;p=cython.git Fix refnanny context warning when in nogil mode --- diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index 99267aa2..9c95a1a0 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -1309,7 +1309,8 @@ class FuncDefNode(StatNode, BlockNode): (self.return_type.declaration_code(Naming.retval_cname), init)) tempvardecl_code = code.insertion_point() - code.put_declare_refcount_context() + if not lenv.nogil: + code.put_declare_refcount_context() self.generate_keyword_list(code) if profile: code.put_trace_declarations()