fix for the #633 fix: cannot create owned reference in nogil sections
authorStefan Behnel <scoder@users.berlios.de>
Mon, 27 Dec 2010 08:36:10 +0000 (09:36 +0100)
committerStefan Behnel <scoder@users.berlios.de>
Mon, 27 Dec 2010 08:36:10 +0000 (09:36 +0100)
Cython/Compiler/ExprNodes.py

index 8aead92cc4bc09ab06f32dc68cca9dbd5aa65641..38ab6813cde8598edbe6bf4df4fda3c76850b9d6 100755 (executable)
@@ -2954,7 +2954,7 @@ class SimpleCallNode(CallNode):
         for i in range(min(max_nargs, actual_nargs)):
             formal_type = func_type.args[i].type
             arg = self.args[i].coerce_to(formal_type, env)
-            if arg.is_attribute or not arg.is_simple:
+            if not env.nogil and (arg.is_attribute or not arg.is_simple):
                 # we do not own the argument's reference, but we must
                 # make sure it cannot be collected before we return
                 # from the function, so we create an owned temp