Commit d2d2ea33 authored by Stefan Behnel's avatar Stefan Behnel

Merge branch '0.29.x'

parents 54546b90 35ab4907
...@@ -409,18 +409,31 @@ static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { ...@@ -409,18 +409,31 @@ static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
static int __Pyx_setup_reduce(PyObject* type_obj) { static int __Pyx_setup_reduce(PyObject* type_obj) {
int ret = 0; int ret = 0;
PyObject *object_reduce = NULL; PyObject *object_reduce = NULL;
PyObject *object_getstate = NULL;
PyObject *object_reduce_ex = NULL; PyObject *object_reduce_ex = NULL;
PyObject *reduce = NULL; PyObject *reduce = NULL;
PyObject *reduce_ex = NULL; PyObject *reduce_ex = NULL;
PyObject *reduce_cython = NULL; PyObject *reduce_cython = NULL;
PyObject *setstate = NULL; PyObject *setstate = NULL;
PyObject *setstate_cython = NULL; PyObject *setstate_cython = NULL;
PyObject *getstate = NULL;
#if CYTHON_USE_PYTYPE_LOOKUP #if CYTHON_USE_PYTYPE_LOOKUP
if (_PyType_Lookup((PyTypeObject*)type_obj, PYIDENT("__getstate__"))) goto __PYX_GOOD; getstate = _PyType_Lookup((PyTypeObject*)type_obj, PYIDENT("__getstate__"));
#else #else
if (PyObject_HasAttr(type_obj, PYIDENT("__getstate__"))) goto __PYX_GOOD; getstate = __Pyx_PyObject_GetAttrStr(type_obj, PYIDENT("__getstate__"));
#endif #endif
if (getstate) {
// Python 3.11 introduces object.__getstate__. Because it's version-specific failure to find it should not be an error
#if CYTHON_USE_PYTYPE_LOOKUP
object_getstate = _PyType_Lookup(&PyBaseObject_Type, PYIDENT("__getstate__"));
#else
object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, PYIDENT("__getstate__"));
#endif
if (object_getstate != getstate) {
goto __PYX_GOOD;
}
}
#if CYTHON_USE_PYTYPE_LOOKUP #if CYTHON_USE_PYTYPE_LOOKUP
object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, PYIDENT("__reduce_ex__")); if (!object_reduce_ex) goto __PYX_BAD; object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, PYIDENT("__reduce_ex__")); if (!object_reduce_ex) goto __PYX_BAD;
...@@ -480,6 +493,8 @@ __PYX_GOOD: ...@@ -480,6 +493,8 @@ __PYX_GOOD:
#if !CYTHON_USE_PYTYPE_LOOKUP #if !CYTHON_USE_PYTYPE_LOOKUP
Py_XDECREF(object_reduce); Py_XDECREF(object_reduce);
Py_XDECREF(object_reduce_ex); Py_XDECREF(object_reduce_ex);
Py_XDECREF(object_getstate);
Py_XDECREF(getstate);
#endif #endif
Py_XDECREF(reduce); Py_XDECREF(reduce);
Py_XDECREF(reduce_ex); Py_XDECREF(reduce_ex);
......
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