From: Stefan Behnel Date: Sat, 12 Jan 2008 10:32:19 +0000 (+0100) Subject: only generate tp_clear/traverse functions if type supports GC X-Git-Tag: 0.9.6.14~29^2~62^2~14 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b357710a635e7f9aef814118377c66c278a11808;p=cython.git only generate tp_clear/traverse functions if type supports GC --- diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py index 758546da..5c78abda 100644 --- a/Cython/Compiler/ModuleNode.py +++ b/Cython/Compiler/ModuleNode.py @@ -566,8 +566,9 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): self.generate_exttype_vtable(scope, code) self.generate_new_function(scope, code) self.generate_dealloc_function(scope, code) - self.generate_traverse_function(scope, code) - self.generate_clear_function(scope, code) + if scope.needs_gc(): + self.generate_traverse_function(scope, code) + self.generate_clear_function(scope, code) if scope.defines_any(["__getitem__"]): self.generate_getitem_int_function(scope, code) if scope.defines_any(["__setitem__", "__delitem__"]):