[3.8] bpo-37250: put back tp_print for backwards compatibility by jdemeyer · Pull Request #14193 · python/cpython · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Include/cpython/object.h
2 changes: 1 addition & 1 deletion Lib/test/test_sys.py
Original file line number Diff line number Diff line change
Expand Up @@ -1275,7 +1275,7 @@ def delx(self): del self.__x
check((1,2,3), vsize('') + 3*self.P)
# type
# static type: PyTypeObject
fmt = 'P2nPI13Pl4Pn9Pn11PIPP'
fmt = 'P2nPI13Pl4Pn9Pn11PIPPP'
if hasattr(sys, 'getcounts'):
fmt += '3n2P'
s = vsize(fmt)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
``tp_print`` is put back at the end of the ``PyTypeObject`` structure
to restore support for old code (in particular generated by Cython)
setting ``tp_print = 0``.
Comment thread
jdemeyer marked this conversation as resolved.
Note that ``tp_print`` will be removed entirely in Python 3.9.
4 changes: 4 additions & 0 deletions Modules/_testcapimodule.c