[3.8] bpo-37250: put back tp_print for backwards compatibility (GH-14… · python/cpython@d917cfe · GitHub
Skip to content

Commit d917cfe

Browse files
jdemeyerencukou
authored andcommitted
[3.8] bpo-37250: put back tp_print for backwards compatibility (GH-14193)
This is a 3.8-only compatibility measure for third-party Cython-based sdists. https://bugs.python.org/issue37250
1 parent d32594a commit d917cfe

4 files changed

Lines changed: 12 additions & 1 deletion

File tree

Include/cpython/object.h

Lines changed: 3 additions & 0 deletions

Lib/test/test_sys.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1275,7 +1275,7 @@ def delx(self): del self.__x
12751275
check((1,2,3), vsize('') + 3*self.P)
12761276
# type
12771277
# static type: PyTypeObject
1278-
fmt = 'P2nPI13Pl4Pn9Pn11PIPP'
1278+
fmt = 'P2nPI13Pl4Pn9Pn11PIPPP'
12791279
if hasattr(sys, 'getcounts'):
12801280
fmt += '3n2P'
12811281
s = vsize(fmt)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
``tp_print`` is put back at the end of the ``PyTypeObject`` structure
2+
to restore support for old code (in particular generated by Cython)
3+
setting ``tp_print = 0``.
4+
Note that ``tp_print`` will be removed entirely in Python 3.9.

Modules/_testcapimodule.c

Lines changed: 4 additions & 0 deletions

0 commit comments

Comments
 (0)