summaryrefslogtreecommitdiff
path: root/Cython/Compiler/ModuleNode.py
diff options
context:
space:
mode:
authorStefan Behnel <stefan_ml@behnel.de>2013-10-16 06:54:27 +0200
committerStefan Behnel <stefan_ml@behnel.de>2013-10-16 06:54:27 +0200
commite471e51ad78bae7dc90f2c922b3eb9ede81f45cb (patch)
tree6a80037ddb9fa8a15f6f795aa54efaeb091ac83f /Cython/Compiler/ModuleNode.py
parent50891af4178152c5d4646da6b072f410a8639446 (diff)
downloadcython-e471e51ad78bae7dc90f2c922b3eb9ede81f45cb.tar.gz
disable unnecessary PyType_IS_GC() check in PyPy (not supported)
Diffstat (limited to 'Cython/Compiler/ModuleNode.py')
-rw-r--r--Cython/Compiler/ModuleNode.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py
index a50702a83..88e6ae046 100644
--- a/Cython/Compiler/ModuleNode.py
+++ b/Cython/Compiler/ModuleNode.py
@@ -1252,8 +1252,10 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
if base_type.scope and base_type.scope.needs_gc():
code.putln("PyObject_GC_Track(o);")
else:
- code.putln("if (PyType_IS_GC(Py_TYPE(o)->tp_base))"
- " PyObject_GC_Track(o);")
+ code.putln("#if CYTHON_COMPILING_IN_CPYTHON")
+ code.putln("if (PyType_IS_GC(Py_TYPE(o)->tp_base))")
+ code.putln("#endif")
+ code.putln("PyObject_GC_Track(o);")
tp_dealloc = TypeSlots.get_base_slot_function(scope, tp_slot)
if tp_dealloc is not None: