From: Stefan Behnel Date: Thu, 27 Nov 2008 13:28:53 +0000 (+0100) Subject: fix usage of new manage_ref keyword for temp handles X-Git-Tag: 0.11-beta~198 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=5c8fc43ebc1624445601cb34afb79570b3ad7478;p=cython.git fix usage of new manage_ref keyword for temp handles --- diff --git a/Cython/Compiler/UtilNodes.py b/Cython/Compiler/UtilNodes.py index 7fcf6fda..58592117 100644 --- a/Cython/Compiler/UtilNodes.py +++ b/Cython/Compiler/UtilNodes.py @@ -79,7 +79,9 @@ class TempsBlockNode(Node): def generate_execution_code(self, code): for handle in self.temps: - handle.temp = code.funcstate.allocate_temp(handle.type, manage_ref=True) + managed = handle.needs_cleanup or not handle.type.is_pyobject + handle.temp = code.funcstate.allocate_temp( + handle.type, manage_ref=managed) self.body.generate_execution_code(code) for handle in self.temps: if handle.needs_cleanup: