From 7fcef20c10590d94e9701c3740b70a73b949af45 Mon Sep 17 00:00:00 2001 From: Will Ayd Date: Sat, 16 Nov 2019 19:45:53 -0800 Subject: [PATCH 1/3] Cleaned up compat for extension modules --- pandas/_libs/src/compat_helper.h | 6 +----- pandas/_libs/src/parser/io.c | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/pandas/_libs/src/compat_helper.h b/pandas/_libs/src/compat_helper.h index 078069fb48af2..0555c5c3f4dfb 100644 --- a/pandas/_libs/src/compat_helper.h +++ b/pandas/_libs/src/compat_helper.h @@ -38,13 +38,9 @@ PANDAS_INLINE int slice_get_indices(PyObject *s, Py_ssize_t *stop, Py_ssize_t *step, Py_ssize_t *slicelength) { -#if PY_VERSION_HEX >= 0x03000000 + return PySlice_GetIndicesEx(s, length, start, stop, step, slicelength); -#else - return PySlice_GetIndicesEx((PySliceObject *)s, length, start, - stop, step, slicelength); -#endif // PY_VERSION_HEX } #endif // PANDAS__LIBS_SRC_COMPAT_HELPER_H_ diff --git a/pandas/_libs/src/parser/io.c b/pandas/_libs/src/parser/io.c index 5d73230f32955..2405a6e07cb39 100644 --- a/pandas/_libs/src/parser/io.c +++ b/pandas/_libs/src/parser/io.c @@ -17,7 +17,7 @@ The full license is in the LICENSE file, distributed with this software. #define O_BINARY 0 #endif // O_BINARY -#if PY_VERSION_HEX >= 0x03060000 && defined(_WIN32) +#ifdef(_WIN32) #define USE_WIN_UTF16 #include #endif From 0a2410edf078881f09a6dd5d3a0db0e287c6cdf7 Mon Sep 17 00:00:00 2001 From: Will Ayd Date: Sun, 17 Nov 2019 16:26:13 -0800 Subject: [PATCH 2/3] macro typo fix --- pandas/_libs/src/parser/io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/_libs/src/parser/io.c b/pandas/_libs/src/parser/io.c index 2405a6e07cb39..aecd4e03664e6 100644 --- a/pandas/_libs/src/parser/io.c +++ b/pandas/_libs/src/parser/io.c @@ -17,7 +17,7 @@ The full license is in the LICENSE file, distributed with this software. #define O_BINARY 0 #endif // O_BINARY -#ifdef(_WIN32) +#ifdef _WIN32 #define USE_WIN_UTF16 #include #endif From a1e26f92085f7f40f7416719987b3979350723f0 Mon Sep 17 00:00:00 2001 From: Will Ayd Date: Sun, 17 Nov 2019 18:03:57 -0800 Subject: [PATCH 3/3] lint --- pandas/_libs/src/compat_helper.h | 1 - 1 file changed, 1 deletion(-) diff --git a/pandas/_libs/src/compat_helper.h b/pandas/_libs/src/compat_helper.h index 0555c5c3f4dfb..01d5b843d1bb6 100644 --- a/pandas/_libs/src/compat_helper.h +++ b/pandas/_libs/src/compat_helper.h @@ -38,7 +38,6 @@ PANDAS_INLINE int slice_get_indices(PyObject *s, Py_ssize_t *stop, Py_ssize_t *step, Py_ssize_t *slicelength) { - return PySlice_GetIndicesEx(s, length, start, stop, step, slicelength); }