| 13222 | return ret; |
| 13223 | } |
| 13224 | static int __Pyx_setup_reduce(PyObject* type_obj) { |
| 13225 | int ret = 0; |
| 13226 | PyObject *object_reduce = NULL; |
| 13227 | PyObject *object_reduce_ex = NULL; |
| 13228 | PyObject *reduce = NULL; |
| 13229 | PyObject *reduce_ex = NULL; |
| 13230 | PyObject *reduce_cython = NULL; |
| 13231 | PyObject *setstate = NULL; |
| 13232 | PyObject *setstate_cython = NULL; |
| 13233 | #if CYTHON_USE_PYTYPE_LOOKUP |
| 13234 | if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD; |
| 13235 | #else |
| 13236 | if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD; |
| 13237 | #endif |
| 13238 | #if CYTHON_USE_PYTYPE_LOOKUP |
| 13239 | object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; |
| 13240 | #else |
| 13241 | object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; |
| 13242 | #endif |
| 13243 | reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD; |
| 13244 | if (reduce_ex == object_reduce_ex) { |
| 13245 | #if CYTHON_USE_PYTYPE_LOOKUP |
| 13246 | object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; |
| 13247 | #else |
| 13248 | object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; |
| 13249 | #endif |
| 13250 | reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD; |
| 13251 | if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { |
| 13252 | reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython); |
| 13253 | if (likely(reduce_cython)) { |
| 13254 | ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; |
| 13255 | ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; |
| 13256 | } else if (reduce == object_reduce || PyErr_Occurred()) { |
| 13257 | goto __PYX_BAD; |
| 13258 | } |
| 13259 | setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate); |
| 13260 | if (!setstate) PyErr_Clear(); |
| 13261 | if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { |
| 13262 | setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython); |
| 13263 | if (likely(setstate_cython)) { |
| 13264 | ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; |
| 13265 | ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; |
| 13266 | } else if (!setstate || PyErr_Occurred()) { |
| 13267 | goto __PYX_BAD; |
| 13268 | } |
| 13269 | } |
| 13270 | PyType_Modified((PyTypeObject*)type_obj); |
| 13271 | } |
| 13272 | } |
| 13273 | goto __PYX_GOOD; |
| 13274 | __PYX_BAD: |
| 13275 | if (!PyErr_Occurred()) |
| 13276 | PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name); |
| 13277 | ret = -1; |
| 13278 | __PYX_GOOD: |
| 13279 | #if !CYTHON_USE_PYTYPE_LOOKUP |
| 13280 | Py_XDECREF(object_reduce); |
| 13281 | Py_XDECREF(object_reduce_ex); |
no test coverage detected