From 2a9ed74644e1861cdd5e6ddcca9a167fa84c34c6 Mon Sep 17 00:00:00 2001 From: Vitja Makarov Date: Fri, 1 Apr 2011 16:10:11 +0200 Subject: [PATCH] Fix refnanny context warning when in nogil mode --- Cython/Compiler/Nodes.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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() -- 2.26.2