Fix refnanny context warning when in nogil mode
authorVitja Makarov <vitja.makarov@gmail.com>
Fri, 1 Apr 2011 14:10:11 +0000 (16:10 +0200)
committerVitja Makarov <vitja.makarov@gmail.com>
Fri, 1 Apr 2011 14:10:11 +0000 (16:10 +0200)
Cython/Compiler/Nodes.py

index 99267aa245d78ad72eb0bdcf86e12ce8507208a3..9c95a1a028b7f6e5e8e7ab3928346a073301f6af 100644 (file)
@@ -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()