diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 2d242ff..a75fcf0 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -13,6 +13,7 @@ Version 3.0.2 ------------------ - Support Python 3.11 +- Regenerate C code accordingly - Drop support for Python 3.6 Thank you diff --git a/intbitset/intbitset.c b/intbitset/intbitset.c index cae9ffb..c435de5 100644 --- a/intbitset/intbitset.c +++ b/intbitset/intbitset.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.29.28 */ +/* Generated by Cython 0.29.33 */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN @@ -9,8 +9,8 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_29_28" -#define CYTHON_HEX_VERSION 0x001D1CF0 +#define CYTHON_ABI "0_29_33" +#define CYTHON_HEX_VERSION 0x001D21F0 #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof @@ -49,6 +49,7 @@ #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_PYSTON 0 #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_PYTYPE_LOOKUP @@ -85,10 +86,14 @@ #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #endif #elif defined(PYSTON_VERSION) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_PYSTON 1 #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif @@ -126,10 +131,59 @@ #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #endif +#elif defined(PY_NOGIL) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_NOGIL 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #ifndef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 1 + #endif + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_PYSTON 0 #define CYTHON_COMPILING_IN_CPYTHON 1 + #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif @@ -179,7 +233,7 @@ #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030B00A1) + #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030A0000) #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) @@ -196,6 +250,9 @@ #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) #endif + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 + #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) @@ -495,11 +552,11 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 - #if defined(PyUnicode_IS_READY) - #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ - 0 : _PyUnicode_Ready((PyObject *)(op))) + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_READY(op) (0) #else - #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) @@ -508,14 +565,14 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) - #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE) - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) - #else - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) - #endif + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) + #endif #endif #else #define CYTHON_PEP393_ENABLED 0 @@ -647,8 +704,10 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { } __Pyx_PyAsyncMethodsStruct; #endif -#if defined(WIN32) || defined(MS_WINDOWS) - #define _USE_MATH_DEFINES +#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) + #if !defined(_USE_MATH_DEFINES) + #define _USE_MATH_DEFINES + #endif #endif #include #ifdef NAN @@ -1137,18 +1196,18 @@ static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UIN /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS -#define __Pyx_GetModuleGlobalName(var, name) {\ +#define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ -} -#define __Pyx_GetModuleGlobalNameUncached(var, name) {\ +} while(0) +#define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ -} +} while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) @@ -5787,7 +5846,7 @@ static PyObject *__pyx_pf_9intbitset_9intbitset_20__iadd__(struct __pyx_obj_9int /* Python wrapper */ static PyObject *__pyx_pw_9intbitset_9intbitset_23__isub__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/ static char __pyx_doc_9intbitset_9intbitset_22__isub__[] = "Remove all elements of another set from this set."; -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_UPDATE_DESCRIPTOR_DOC struct wrapperbase __pyx_wrapperbase_9intbitset_9intbitset_22__isub__; #endif static PyObject *__pyx_pw_9intbitset_9intbitset_23__isub__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) { @@ -6278,7 +6337,7 @@ static PyObject *__pyx_pf_9intbitset_9intbitset_22__isub__(struct __pyx_obj_9int /* Python wrapper */ static PyObject *__pyx_pw_9intbitset_9intbitset_25__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/ static char __pyx_doc_9intbitset_9intbitset_24__sub__[] = "Return the difference of two intbitsets as a new set.\n (i.e. all elements that are in this intbitset but not the other.)\n "; -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_UPDATE_DESCRIPTOR_DOC struct wrapperbase __pyx_wrapperbase_9intbitset_9intbitset_24__sub__; #endif static PyObject *__pyx_pw_9intbitset_9intbitset_25__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) { @@ -6383,7 +6442,7 @@ static PyObject *__pyx_pf_9intbitset_9intbitset_24__sub__(PyObject *__pyx_v_self /* Python wrapper */ static PyObject *__pyx_pw_9intbitset_9intbitset_27__and__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/ static char __pyx_doc_9intbitset_9intbitset_26__and__[] = "Return the intersection of two intbitsets as a new set.\n (i.e. all elements that are in both intbitsets.)\n "; -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_UPDATE_DESCRIPTOR_DOC struct wrapperbase __pyx_wrapperbase_9intbitset_9intbitset_26__and__; #endif static PyObject *__pyx_pw_9intbitset_9intbitset_27__and__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) { @@ -6488,7 +6547,7 @@ static PyObject *__pyx_pf_9intbitset_9intbitset_26__and__(PyObject *__pyx_v_self /* Python wrapper */ static PyObject *__pyx_pw_9intbitset_9intbitset_29__iand__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/ static char __pyx_doc_9intbitset_9intbitset_28__iand__[] = "Update a intbitset with the intersection of itself and another."; -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_UPDATE_DESCRIPTOR_DOC struct wrapperbase __pyx_wrapperbase_9intbitset_9intbitset_28__iand__; #endif static PyObject *__pyx_pw_9intbitset_9intbitset_29__iand__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) { @@ -6565,7 +6624,7 @@ static PyObject *__pyx_pf_9intbitset_9intbitset_28__iand__(struct __pyx_obj_9int /* Python wrapper */ static PyObject *__pyx_pw_9intbitset_9intbitset_31__or__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/ static char __pyx_doc_9intbitset_9intbitset_30__or__[] = "Return the union of two intbitsets as a new set.\n (i.e. all elements that are in either intbitsets.)\n "; -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_UPDATE_DESCRIPTOR_DOC struct wrapperbase __pyx_wrapperbase_9intbitset_9intbitset_30__or__; #endif static PyObject *__pyx_pw_9intbitset_9intbitset_31__or__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) { @@ -6670,7 +6729,7 @@ static PyObject *__pyx_pf_9intbitset_9intbitset_30__or__(PyObject *__pyx_v_self, /* Python wrapper */ static PyObject *__pyx_pw_9intbitset_9intbitset_33__ior__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/ static char __pyx_doc_9intbitset_9intbitset_32__ior__[] = "Update a intbitset with the union of itself and another."; -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_UPDATE_DESCRIPTOR_DOC struct wrapperbase __pyx_wrapperbase_9intbitset_9intbitset_32__ior__; #endif static PyObject *__pyx_pw_9intbitset_9intbitset_33__ior__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) { @@ -6747,7 +6806,7 @@ static PyObject *__pyx_pf_9intbitset_9intbitset_32__ior__(struct __pyx_obj_9intb /* Python wrapper */ static PyObject *__pyx_pw_9intbitset_9intbitset_35__xor__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/ static char __pyx_doc_9intbitset_9intbitset_34__xor__[] = "Return the symmetric difference of two sets as a new set.\n (i.e. all elements that are in exactly one of the sets.)\n "; -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_UPDATE_DESCRIPTOR_DOC struct wrapperbase __pyx_wrapperbase_9intbitset_9intbitset_34__xor__; #endif static PyObject *__pyx_pw_9intbitset_9intbitset_35__xor__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) { @@ -6852,7 +6911,7 @@ static PyObject *__pyx_pf_9intbitset_9intbitset_34__xor__(PyObject *__pyx_v_self /* Python wrapper */ static PyObject *__pyx_pw_9intbitset_9intbitset_37__ixor__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/ static char __pyx_doc_9intbitset_9intbitset_36__ixor__[] = "Update an intbitset with the symmetric difference of itself and another.\n "; -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_UPDATE_DESCRIPTOR_DOC struct wrapperbase __pyx_wrapperbase_9intbitset_9intbitset_36__ixor__; #endif static PyObject *__pyx_pw_9intbitset_9intbitset_37__ixor__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) { @@ -14660,7 +14719,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { } static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { - if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) __PYX_ERR(0, 1, __pyx_L1_error) @@ -14735,7 +14794,7 @@ static int __Pyx_modinit_type_init_code(void) { if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9intbitset_intbitset.tp_dictoffset && __pyx_type_9intbitset_intbitset.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_9intbitset_intbitset.tp_getattro = __Pyx_PyObject_GenericGetAttr; } - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_UPDATE_DESCRIPTOR_DOC { PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_9intbitset_intbitset, "__isub__"); if (unlikely(!wrapper)) __PYX_ERR(0, 110, __pyx_L1_error) if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { @@ -14745,7 +14804,7 @@ static int __Pyx_modinit_type_init_code(void) { } } #endif - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_UPDATE_DESCRIPTOR_DOC { PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_9intbitset_intbitset, "__sub__"); if (unlikely(!wrapper)) __PYX_ERR(0, 110, __pyx_L1_error) if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { @@ -14755,7 +14814,7 @@ static int __Pyx_modinit_type_init_code(void) { } } #endif - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_UPDATE_DESCRIPTOR_DOC { PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_9intbitset_intbitset, "__and__"); if (unlikely(!wrapper)) __PYX_ERR(0, 110, __pyx_L1_error) if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { @@ -14765,7 +14824,7 @@ static int __Pyx_modinit_type_init_code(void) { } } #endif - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_UPDATE_DESCRIPTOR_DOC { PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_9intbitset_intbitset, "__iand__"); if (unlikely(!wrapper)) __PYX_ERR(0, 110, __pyx_L1_error) if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { @@ -14775,7 +14834,7 @@ static int __Pyx_modinit_type_init_code(void) { } } #endif - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_UPDATE_DESCRIPTOR_DOC { PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_9intbitset_intbitset, "__or__"); if (unlikely(!wrapper)) __PYX_ERR(0, 110, __pyx_L1_error) if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { @@ -14785,7 +14844,7 @@ static int __Pyx_modinit_type_init_code(void) { } } #endif - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_UPDATE_DESCRIPTOR_DOC { PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_9intbitset_intbitset, "__ior__"); if (unlikely(!wrapper)) __PYX_ERR(0, 110, __pyx_L1_error) if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { @@ -14795,7 +14854,7 @@ static int __Pyx_modinit_type_init_code(void) { } } #endif - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_UPDATE_DESCRIPTOR_DOC { PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_9intbitset_intbitset, "__xor__"); if (unlikely(!wrapper)) __PYX_ERR(0, 110, __pyx_L1_error) if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { @@ -14805,7 +14864,7 @@ static int __Pyx_modinit_type_init_code(void) { } } #endif - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_UPDATE_DESCRIPTOR_DOC { PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_9intbitset_intbitset, "__ixor__"); if (unlikely(!wrapper)) __PYX_ERR(0, 110, __pyx_L1_error) if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { @@ -15029,7 +15088,7 @@ if (!__Pyx_RefNanny) { Py_INCREF(__pyx_b); __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_cython_runtime); - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) @@ -15885,7 +15944,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { return __Pyx_PyFunction_FastCall(func, NULL, 0); } #endif -#ifdef __Pyx_CyFunction_USED +#if defined(__Pyx_CyFunction_USED) && defined(NDEBUG) if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func))) #else if (likely(PyCFunction_Check(func))) @@ -16451,10 +16510,8 @@ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; - } else { - return __Pyx_IterFinish(); } - return 0; + return __Pyx_IterFinish(); } /* StringJoin */ @@ -16920,17 +16977,35 @@ static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { static int __Pyx_setup_reduce(PyObject* type_obj) { int ret = 0; PyObject *object_reduce = NULL; + PyObject *object_getstate = NULL; PyObject *object_reduce_ex = NULL; PyObject *reduce = NULL; PyObject *reduce_ex = NULL; PyObject *reduce_cython = NULL; PyObject *setstate = NULL; PyObject *setstate_cython = NULL; + PyObject *getstate = NULL; #if CYTHON_USE_PYTYPE_LOOKUP - if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD; + getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate); #else - if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD; + getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate); + if (!getstate && PyErr_Occurred()) { + goto __PYX_BAD; + } +#endif + if (getstate) { +#if CYTHON_USE_PYTYPE_LOOKUP + object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate); +#else + object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate); + if (!object_getstate && PyErr_Occurred()) { + goto __PYX_BAD; + } #endif + if (object_getstate != getstate) { + goto __PYX_GOOD; + } + } #if CYTHON_USE_PYTYPE_LOOKUP object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #else @@ -16975,6 +17050,8 @@ static int __Pyx_setup_reduce(PyObject* type_obj) { #if !CYTHON_USE_PYTYPE_LOOKUP Py_XDECREF(object_reduce); Py_XDECREF(object_reduce_ex); + Py_XDECREF(object_getstate); + Py_XDECREF(getstate); #endif Py_XDECREF(reduce); Py_XDECREF(reduce_ex); @@ -17085,7 +17162,7 @@ static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name) { /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK -static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) { +static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON @@ -17208,16 +17285,13 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { /* AddTraceback */ #include "compile.h" #include "frameobject.h" +#include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif - #ifndef PYCORE_FRAME - #include "internal/pycore_frame.h" - #define PYCORE_FRAME - #endif + #include "internal/pycore_frame.h" #endif -#include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { @@ -17281,14 +17355,24 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); - if (!py_code) goto bad; + if (!py_code) { + /* If the code object creation fails, then we should clear the + fetched exception references and propagate the new exception */ + Py_XDECREF(ptype); + Py_XDECREF(pvalue); + Py_XDECREF(ptraceback); + goto bad; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( @@ -18131,11 +18215,33 @@ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObj /* CheckBinaryVersion */ static int __Pyx_check_binary_version(void) { - char ctversion[4], rtversion[4]; - PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); - PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); - if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char ctversion[5]; + int same=1, i, found_dot; + const char* rt_from_call = Py_GetVersion(); + PyOS_snprintf(ctversion, 5, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + found_dot = 0; + for (i = 0; i < 4; i++) { + if (!ctversion[i]) { + same = (rt_from_call[i] < '0' || rt_from_call[i] > '9'); + break; + } + if (rt_from_call[i] != ctversion[i]) { + same = 0; + break; + } + } + if (!same) { + char rtversion[5] = {'\0'}; char message[200]; + for (i=0; i<4; ++i) { + if (rt_from_call[i] == '.') { + if (found_dot) break; + found_dot = 1; + } else if (rt_from_call[i] < '0' || rt_from_call[i] > '9') { + break; + } + rtversion[i] = rt_from_call[i]; + } PyOS_snprintf(message, sizeof(message), "compiletime version %s of module '%.100s' " "does not match runtime version %s",