Skip to content

Commit 3a4b484

Browse files
stefanordavidmalcolm
authored andcommitted
Build on Python 3.8
PEP-590 replaced tp_print with tp_vectorcall_offset
1 parent 8276f91 commit 3a4b484

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cpybuilder.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,11 @@ def c_initializer(self):
254254
result += ' sizeof(%(struct_name)s), /*tp_basicsize*/\n' % self.__dict__
255255
result += ' 0, /*tp_itemsize*/\n'
256256
result += self.c_ptr_field('tp_dealloc')
257+
result += '#if PY_VERSION_HEX >= 0x03080000\n'
258+
result += ' 0, /*tp_vectorcall_offset*/\n'
259+
result += '#else\n'
257260
result += self.c_ptr_field('tp_print')
261+
result += '#endif\n'
258262
result += self.c_ptr_field('tp_getattr')
259263
result += self.c_ptr_field('tp_setattr')
260264
result += '#if PY_MAJOR_VERSION < 3\n' % self.__dict__

0 commit comments

Comments
 (0)