From 56d9591aef916be34b4e20dc70f5b439a8a937f3 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Fri, 28 Jan 2011 09:35:47 +0100 Subject: [PATCH] build fix for the last self argument change --- Cython/Compiler/ExprNodes.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index 8d10c17c..254554b8 100755 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -2965,10 +2965,13 @@ class SimpleCallNode(CallNode): if arg.is_temp: some_args_in_temps = True elif arg.type.is_pyobject and not env.nogil: - if arg.is_name or (i == 0 and self.self is not None): - # names and a method's cloned "self" argument are ok + if i == 0 and self.self is not None: + # a method's cloned "self" argument is ok + pass + elif arg.is_name and arg.entry and arg.entry.is_local and not arg.entry.in_closure: + # plain local variables are ok pass - elif arg.entry and (not arg.entry.is_local or arg.entry.in_closure): + else: # we do not safely own the argument's reference, # but we must make sure it cannot be collected # before we return from the function, so we create -- 2.26.2