Commit 571b4bc0 authored by Mark Florisson's avatar Mark Florisson

Use __Pyx_PyIndex_Check instead of PyIndex_Check

parent a762a4d8
...@@ -246,6 +246,6 @@ cdef extern from "Python.h": ...@@ -246,6 +246,6 @@ cdef extern from "Python.h":
# and the value is clipped to PY_SSIZE_T_MIN for a negative # and the value is clipped to PY_SSIZE_T_MIN for a negative
# integer or PY_SSIZE_T_MAX for a positive integer. # integer or PY_SSIZE_T_MAX for a positive integer.
bint PyIndex_Check(object o) bint PyIndex_Check "__Pyx_PyIndex_Check" (object)
# Returns True if o is an index integer (has the nb_index slot of # Returns True if o is an index integer (has the nb_index slot of
# the tp_as_number structure filled in). # the tp_as_number structure filled in).
...@@ -6,7 +6,7 @@ import cython ...@@ -6,7 +6,7 @@ import cython
# from cpython cimport ... # from cpython cimport ...
cdef extern from "Python.h": cdef extern from "Python.h":
int PyIndex_Check(object) int PyIndex_Check "__Pyx_PyIndex_Check" (object)
object PyLong_FromVoidPtr(void *) object PyLong_FromVoidPtr(void *)
cdef extern from "pythread.h": cdef extern from "pythread.h":
......
...@@ -115,12 +115,6 @@ static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(__pyx_atomic_int *ac ...@@ -115,12 +115,6 @@ static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(__pyx_atomic_int *ac
#define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__) #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
static CYTHON_INLINE void __Pyx_INC_MEMVIEW({{memviewslice_name}} *, int, int); static CYTHON_INLINE void __Pyx_INC_MEMVIEW({{memviewslice_name}} *, int, int);
static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW({{memviewslice_name}} *, int, int); static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW({{memviewslice_name}} *, int, int);
#if PY_VERSION_HEX < 0x02050000
/* NumPy headers define PyIndex_Check incorrectly */
#undef PyIndex_Check
#define PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && !PyComplex_Check(o))
#endif
/////////////// MemviewSliceIndex.proto /////////////// /////////////// MemviewSliceIndex.proto ///////////////
static CYTHON_INLINE char *__pyx_memviewslice_index_full(const char *bufp, Py_ssize_t idx, Py_ssize_t stride, Py_ssize_t suboffset); static CYTHON_INLINE char *__pyx_memviewslice_index_full(const char *bufp, Py_ssize_t idx, Py_ssize_t stride, Py_ssize_t suboffset);
......
...@@ -52,12 +52,15 @@ ...@@ -52,12 +52,15 @@
(PyErr_Format(PyExc_TypeError, \ (PyErr_Format(PyExc_TypeError, \
"expected index value, got %.200s", Py_TYPE(o)->tp_name), \ "expected index value, got %.200s", Py_TYPE(o)->tp_name), \
(PyObject*)0)) (PyObject*)0))
#define PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && !PyComplex_Check(o)) #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \
!PyComplex_Check(o))
#define PyIndex_Check __Pyx_PyIndex_Check
#define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
#define __PYX_BUILD_PY_SSIZE_T "i" #define __PYX_BUILD_PY_SSIZE_T "i"
#else #else
#define __PYX_BUILD_PY_SSIZE_T "n" #define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z" #define CYTHON_FORMAT_SSIZE_T "z"
#define __Pyx_PyIndex_Check PyIndex_Check
#endif #endif
#if PY_VERSION_HEX < 0x02060000 #if PY_VERSION_HEX < 0x02060000
......
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