Commit a68ef915 authored by Matti Picus's avatar Matti Picus Committed by GitHub

Guard uses of tp_pypy_flags and tp_vectorcall on PyPy (GH-4509)

For PyPy3.8 (the current release is 7.3.7)

* PyPy<7.3.8 declares a struct with the last fields tp_finalize, tp_print, tp_pypy_flags
* PyPy>=7.3.8 will declare a struct with the last fields tp_finalize, tp_vectorcall, tp_print

PyPy3.9 (not yet released) will declare a struct with the last fields tp_finalize, tp_vectorcall, tp_pypy_flags

See https://foss.heptapod.net/pypy/pypy/-/issues/3618
parent 14ec0d11
...@@ -1076,10 +1076,10 @@ class SlotTable(object): ...@@ -1076,10 +1076,10 @@ class SlotTable(object):
EmptySlot("tp_version_tag"), EmptySlot("tp_version_tag"),
SyntheticSlot("tp_finalize", ["__del__"], "0", ifdef="PY_VERSION_HEX >= 0x030400a1", SyntheticSlot("tp_finalize", ["__del__"], "0", ifdef="PY_VERSION_HEX >= 0x030400a1",
used_ifdef="CYTHON_USE_TP_FINALIZE"), used_ifdef="CYTHON_USE_TP_FINALIZE"),
EmptySlot("tp_vectorcall", ifdef="PY_VERSION_HEX >= 0x030800b1"), EmptySlot("tp_vectorcall", ifdef="PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)"),
EmptySlot("tp_print", ifdef="PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000"), EmptySlot("tp_print", ifdef="PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000"),
# PyPy specific extension - only here to avoid C compiler warnings. # PyPy specific extension - only here to avoid C compiler warnings.
EmptySlot("tp_pypy_flags", ifdef="CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000"), EmptySlot("tp_pypy_flags", ifdef="CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX > 0x03080000"),
) )
#------------------------------------------------------------------------------------------ #------------------------------------------------------------------------------------------
......
...@@ -457,13 +457,13 @@ static PyTypeObject __pyx_AsyncGenType_type = { ...@@ -457,13 +457,13 @@ static PyTypeObject __pyx_AsyncGenType_type = {
#elif PY_VERSION_HEX >= 0x030400a1 #elif PY_VERSION_HEX >= 0x030400a1
0, /* tp_finalize */ 0, /* tp_finalize */
#endif #endif
#if PY_VERSION_HEX >= 0x030800b1 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
0, /*tp_vectorcall*/ 0, /*tp_vectorcall*/
#endif #endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
0, /*tp_print*/ 0, /*tp_print*/
#endif #endif
#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX > 0x03080000
0, /*tp_pypy_flags*/ 0, /*tp_pypy_flags*/
#endif #endif
}; };
...@@ -726,13 +726,13 @@ static PyTypeObject __pyx__PyAsyncGenASendType_type = { ...@@ -726,13 +726,13 @@ static PyTypeObject __pyx__PyAsyncGenASendType_type = {
#if PY_VERSION_HEX >= 0x030400a1 #if PY_VERSION_HEX >= 0x030400a1
0, /* tp_finalize */ 0, /* tp_finalize */
#endif #endif
#if PY_VERSION_HEX >= 0x030800b1 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
0, /*tp_vectorcall*/ 0, /*tp_vectorcall*/
#endif #endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
0, /*tp_print*/ 0, /*tp_print*/
#endif #endif
#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX > 0x03080000
0, /*tp_pypy_flags*/ 0, /*tp_pypy_flags*/
#endif #endif
}; };
...@@ -861,13 +861,13 @@ static PyTypeObject __pyx__PyAsyncGenWrappedValueType_type = { ...@@ -861,13 +861,13 @@ static PyTypeObject __pyx__PyAsyncGenWrappedValueType_type = {
#if PY_VERSION_HEX >= 0x030400a1 #if PY_VERSION_HEX >= 0x030400a1
0, /* tp_finalize */ 0, /* tp_finalize */
#endif #endif
#if PY_VERSION_HEX >= 0x030800b1 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
0, /*tp_vectorcall*/ 0, /*tp_vectorcall*/
#endif #endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
0, /*tp_print*/ 0, /*tp_print*/
#endif #endif
#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX > 0x03080000
0, /*tp_pypy_flags*/ 0, /*tp_pypy_flags*/
#endif #endif
}; };
...@@ -1199,13 +1199,13 @@ static PyTypeObject __pyx__PyAsyncGenAThrowType_type = { ...@@ -1199,13 +1199,13 @@ static PyTypeObject __pyx__PyAsyncGenAThrowType_type = {
#if PY_VERSION_HEX >= 0x030400a1 #if PY_VERSION_HEX >= 0x030400a1
0, /* tp_finalize */ 0, /* tp_finalize */
#endif #endif
#if PY_VERSION_HEX >= 0x030800b1 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
0, /*tp_vectorcall*/ 0, /*tp_vectorcall*/
#endif #endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
0, /*tp_print*/ 0, /*tp_print*/
#endif #endif
#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX > 0x03080000
0, /*tp_pypy_flags*/ 0, /*tp_pypy_flags*/
#endif #endif
}; };
......
...@@ -1616,13 +1616,13 @@ static PyTypeObject __pyx_CoroutineAwaitType_type = { ...@@ -1616,13 +1616,13 @@ static PyTypeObject __pyx_CoroutineAwaitType_type = {
#if PY_VERSION_HEX >= 0x030400a1 #if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/ 0, /*tp_finalize*/
#endif #endif
#if PY_VERSION_HEX >= 0x030800b1 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
0, /*tp_vectorcall*/ 0, /*tp_vectorcall*/
#endif #endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
0, /*tp_print*/ 0, /*tp_print*/
#endif #endif
#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX > 0x03080000
0, /*tp_pypy_flags*/ 0, /*tp_pypy_flags*/
#endif #endif
}; };
...@@ -1805,13 +1805,13 @@ static PyTypeObject __pyx_CoroutineType_type = { ...@@ -1805,13 +1805,13 @@ static PyTypeObject __pyx_CoroutineType_type = {
#elif PY_VERSION_HEX >= 0x030400a1 #elif PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/ 0, /*tp_finalize*/
#endif #endif
#if PY_VERSION_HEX >= 0x030800b1 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
0, /*tp_vectorcall*/ 0, /*tp_vectorcall*/
#endif #endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
0, /*tp_print*/ 0, /*tp_print*/
#endif #endif
#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX > 0x03080000
0, /*tp_pypy_flags*/ 0, /*tp_pypy_flags*/
#endif #endif
}; };
...@@ -1955,13 +1955,13 @@ static PyTypeObject __pyx_IterableCoroutineType_type = { ...@@ -1955,13 +1955,13 @@ static PyTypeObject __pyx_IterableCoroutineType_type = {
#if PY_VERSION_HEX >= 0x030400a1 && !CYTHON_COMPILING_IN_PYPY #if PY_VERSION_HEX >= 0x030400a1 && !CYTHON_COMPILING_IN_PYPY
__Pyx_Coroutine_del, /*tp_finalize*/ __Pyx_Coroutine_del, /*tp_finalize*/
#endif #endif
#if PY_VERSION_HEX >= 0x030800b1 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
0, /*tp_vectorcall*/ 0, /*tp_vectorcall*/
#endif #endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
0, /*tp_print*/ 0, /*tp_print*/
#endif #endif
#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX > 0x03080000
0, /*tp_pypy_flags*/ 0, /*tp_pypy_flags*/
#endif #endif
}; };
...@@ -2101,13 +2101,13 @@ static PyTypeObject __pyx_GeneratorType_type = { ...@@ -2101,13 +2101,13 @@ static PyTypeObject __pyx_GeneratorType_type = {
#elif PY_VERSION_HEX >= 0x030400a1 #elif PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/ 0, /*tp_finalize*/
#endif #endif
#if PY_VERSION_HEX >= 0x030800b1 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
0, /*tp_vectorcall*/ 0, /*tp_vectorcall*/
#endif #endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
0, /*tp_print*/ 0, /*tp_print*/
#endif #endif
#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX > 0x03080000
0, /*tp_pypy_flags*/ 0, /*tp_pypy_flags*/
#endif #endif
}; };
......
...@@ -1035,13 +1035,13 @@ static PyTypeObject __pyx_CyFunctionType_type = { ...@@ -1035,13 +1035,13 @@ static PyTypeObject __pyx_CyFunctionType_type = {
#if PY_VERSION_HEX >= 0x030400a1 #if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/ 0, /*tp_finalize*/
#endif #endif
#if PY_VERSION_HEX >= 0x030800b1 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
0, /*tp_vectorcall*/ 0, /*tp_vectorcall*/
#endif #endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
0, /*tp_print*/ 0, /*tp_print*/
#endif #endif
#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX > 0x03080000
0, /*tp_pypy_flags*/ 0, /*tp_pypy_flags*/
#endif #endif
}; };
...@@ -1576,13 +1576,13 @@ static PyTypeObject __pyx_FusedFunctionType_type = { ...@@ -1576,13 +1576,13 @@ static PyTypeObject __pyx_FusedFunctionType_type = {
#if PY_VERSION_HEX >= 0x030400a1 #if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/ 0, /*tp_finalize*/
#endif #endif
#if PY_VERSION_HEX >= 0x030800b1 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
0, /*tp_vectorcall*/ 0, /*tp_vectorcall*/
#endif #endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
0, /*tp_print*/ 0, /*tp_print*/
#endif #endif
#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX > 0x03080000
0, /*tp_pypy_flags*/ 0, /*tp_pypy_flags*/
#endif #endif
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment