diff options
author | Mark Florisson <markflorisson88@gmail.com> | 2012-11-10 21:31:41 +0000 |
---|---|---|
committer | Mark Florisson <markflorisson88@gmail.com> | 2012-11-10 21:31:41 +0000 |
commit | a762a4d81df2ed961ea1562ce79df584742eed36 (patch) | |
tree | 8983b2704431ee1219ce85548894c27e968825d5 | |
parent | 15dce27569dd7624671964ad37d46810f3444ee7 (diff) | |
download | cython-a762a4d81df2ed961ea1562ce79df584742eed36.tar.gz |
Redefine PyIndex_Check in memoryview utility
-rw-r--r-- | Cython/Utility/MemoryView_C.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Cython/Utility/MemoryView_C.c b/Cython/Utility/MemoryView_C.c index bab3cad56..66329a44a 100644 --- a/Cython/Utility/MemoryView_C.c +++ b/Cython/Utility/MemoryView_C.c @@ -116,6 +116,11 @@ static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(__pyx_atomic_int *ac static CYTHON_INLINE void __Pyx_INC_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 /////////////// static CYTHON_INLINE char *__pyx_memviewslice_index_full(const char *bufp, Py_ssize_t idx, Py_ssize_t stride, Py_ssize_t suboffset); |