From 5c8fc43ebc1624445601cb34afb79570b3ad7478 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Thu, 27 Nov 2008 14:28:53 +0100 Subject: [PATCH] fix usage of new manage_ref keyword for temp handles --- Cython/Compiler/UtilNodes.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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: -- 2.26.2