Commit 53327193 authored by Stefan Behnel's avatar Stefan Behnel

Use concrete macro for "tp_finalize" usage everywhere instead of Python version check.

parent 2c517ecc
...@@ -873,7 +873,7 @@ slot_table = ( ...@@ -873,7 +873,7 @@ slot_table = (
EmptySlot("tp_weaklist"), EmptySlot("tp_weaklist"),
EmptySlot("tp_del"), EmptySlot("tp_del"),
EmptySlot("tp_version_tag"), EmptySlot("tp_version_tag"),
EmptySlot("tp_finalize", ifdef="PY_VERSION_HEX >= 0x030400a1"), EmptySlot("tp_finalize", ifdef="CYTHON_USE_TP_FINALIZE"),
) )
#------------------------------------------------------------------------------------------ #------------------------------------------------------------------------------------------
......
...@@ -620,7 +620,7 @@ static PyTypeObject __pyx__PyAsyncGenASendType_type = { ...@@ -620,7 +620,7 @@ static PyTypeObject __pyx__PyAsyncGenASendType_type = {
0, /* tp_weaklist */ 0, /* tp_weaklist */
0, /* tp_del */ 0, /* tp_del */
0, /* tp_version_tag */ 0, /* tp_version_tag */
#if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE
0, /* tp_finalize */ 0, /* tp_finalize */
#endif #endif
}; };
...@@ -729,7 +729,7 @@ static PyTypeObject __pyx__PyAsyncGenWrappedValueType_type = { ...@@ -729,7 +729,7 @@ static PyTypeObject __pyx__PyAsyncGenWrappedValueType_type = {
0, /* tp_weaklist */ 0, /* tp_weaklist */
0, /* tp_del */ 0, /* tp_del */
0, /* tp_version_tag */ 0, /* tp_version_tag */
#if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE
0, /* tp_finalize */ 0, /* tp_finalize */
#endif #endif
}; };
...@@ -1006,7 +1006,7 @@ static PyTypeObject __pyx__PyAsyncGenAThrowType_type = { ...@@ -1006,7 +1006,7 @@ static PyTypeObject __pyx__PyAsyncGenAThrowType_type = {
0, /* tp_weaklist */ 0, /* tp_weaklist */
0, /* tp_del */ 0, /* tp_del */
0, /* tp_version_tag */ 0, /* tp_version_tag */
#if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE
0, /* tp_finalize */ 0, /* tp_finalize */
#endif #endif
}; };
......
...@@ -1071,7 +1071,7 @@ static void __Pyx_Coroutine_dealloc(PyObject *self) { ...@@ -1071,7 +1071,7 @@ static void __Pyx_Coroutine_dealloc(PyObject *self) {
if (gen->resume_label >= 0) { if (gen->resume_label >= 0) {
// Generator is paused or unstarted, so we need to close // Generator is paused or unstarted, so we need to close
PyObject_GC_Track(self); PyObject_GC_Track(self);
#if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE
if (PyObject_CallFinalizerFromDealloc(self)) if (PyObject_CallFinalizerFromDealloc(self))
#else #else
Py_TYPE(gen)->tp_del(self); Py_TYPE(gen)->tp_del(self);
...@@ -1106,7 +1106,7 @@ static void __Pyx_Coroutine_del(PyObject *self) { ...@@ -1106,7 +1106,7 @@ static void __Pyx_Coroutine_del(PyObject *self) {
return; return;
} }
#if PY_VERSION_HEX < 0x030400a1 #if !CYTHON_USE_TP_FINALIZE
// Temporarily resurrect the object. // Temporarily resurrect the object.
assert(self->ob_refcnt == 0); assert(self->ob_refcnt == 0);
self->ob_refcnt = 1; self->ob_refcnt = 1;
...@@ -1187,7 +1187,7 @@ static void __Pyx_Coroutine_del(PyObject *self) { ...@@ -1187,7 +1187,7 @@ static void __Pyx_Coroutine_del(PyObject *self) {
// Restore the saved exception. // Restore the saved exception.
__Pyx_ErrRestore(error_type, error_value, error_traceback); __Pyx_ErrRestore(error_type, error_value, error_traceback);
#if PY_VERSION_HEX < 0x030400a1 #if !CYTHON_USE_TP_FINALIZE
// Undo the temporary resurrection; can't use DECREF here, it would // Undo the temporary resurrection; can't use DECREF here, it would
// cause a recursive call. // cause a recursive call.
assert(self->ob_refcnt > 0); assert(self->ob_refcnt > 0);
...@@ -1430,7 +1430,7 @@ static PyTypeObject __pyx_CoroutineAwaitType_type = { ...@@ -1430,7 +1430,7 @@ static PyTypeObject __pyx_CoroutineAwaitType_type = {
0, /*tp_weaklist*/ 0, /*tp_weaklist*/
0, /*tp_del*/ 0, /*tp_del*/
0, /*tp_version_tag*/ 0, /*tp_version_tag*/
#if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE
0, /*tp_finalize*/ 0, /*tp_finalize*/
#endif #endif
}; };
...@@ -2055,7 +2055,7 @@ static PyTypeObject __Pyx__PyExc_StopAsyncIteration_type = { ...@@ -2055,7 +2055,7 @@ static PyTypeObject __Pyx__PyExc_StopAsyncIteration_type = {
0, /*tp_weaklist*/ 0, /*tp_weaklist*/
0, /*tp_del*/ 0, /*tp_del*/
0, /*tp_version_tag*/ 0, /*tp_version_tag*/
#if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE
0, /*tp_finalize*/ 0, /*tp_finalize*/
#endif #endif
}; };
......
...@@ -722,7 +722,7 @@ static PyTypeObject __pyx_CyFunctionType_type = { ...@@ -722,7 +722,7 @@ static PyTypeObject __pyx_CyFunctionType_type = {
0, /*tp_weaklist*/ 0, /*tp_weaklist*/
0, /*tp_del*/ 0, /*tp_del*/
0, /*tp_version_tag*/ 0, /*tp_version_tag*/
#if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE
0, /*tp_finalize*/ 0, /*tp_finalize*/
#endif #endif
}; };
...@@ -1195,7 +1195,7 @@ static PyTypeObject __pyx_FusedFunctionType_type = { ...@@ -1195,7 +1195,7 @@ static PyTypeObject __pyx_FusedFunctionType_type = {
0, /*tp_weaklist*/ 0, /*tp_weaklist*/
0, /*tp_del*/ 0, /*tp_del*/
0, /*tp_version_tag*/ 0, /*tp_version_tag*/
#if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE
0, /*tp_finalize*/ 0, /*tp_finalize*/
#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