summaryrefslogtreecommitdiff
path: root/Cython/Compiler/ModuleNode.py
diff options
context:
space:
mode:
authorRobert Bradshaw <robertwb@gmail.com>2013-11-01 20:31:38 -0700
committerRobert Bradshaw <robertwb@gmail.com>2013-11-01 20:31:38 -0700
commit31890343f048e58ebe7986cf56d6fbdeaf7c16b7 (patch)
treeea2791a9b7fbc8d8b65bc4f1a7c5d66253ca6401 /Cython/Compiler/ModuleNode.py
parent2cf64fd4e3e1f5d570d856c2e98fdc51930f1a50 (diff)
downloadcython-31890343f048e58ebe7986cf56d6fbdeaf7c16b7.tar.gz
Clear tp_print for cdef classes.
Diffstat (limited to 'Cython/Compiler/ModuleNode.py')
-rw-r--r--Cython/Compiler/ModuleNode.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py
index 88e6ae046..49b61e0cd 100644
--- a/Cython/Compiler/ModuleNode.py
+++ b/Cython/Compiler/ModuleNode.py
@@ -2514,6 +2514,9 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
"if (PyType_Ready(&%s) < 0) %s" % (
typeobj_cname,
code.error_goto(entry.pos)))
+ # Don't inherit tp_dict from builting types, restoring the
+ # behavior of using tp_repr or tp_str instead.
+ code.putln("%s.tp_print = 0;" % typeobj_cname)
# Fix special method docstrings. This is a bit of a hack, but
# unless we let PyType_Ready create the slot wrappers we have
# a significant performance hit. (See trac #561.)