diff options
author | Pauli Virtanen <pav@iki.fi> | 2012-06-11 22:21:30 +0200 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2012-07-13 10:03:33 -0600 |
commit | 423ddfb0484eecdf825209337b20ec929f038b6f (patch) | |
tree | e1b6e153acbbaa3197181429f2ac78ed2ddea505 /numpy | |
parent | ce0a7912e2e909cae4c4d2fc6d9745a97d2161c2 (diff) | |
download | numpy-423ddfb0484eecdf825209337b20ec929f038b6f.tar.gz |
STY: core: move non-Py3 specific stuff out from npy_3kcompat.h to private npy_pycompat.h
npy_3kcompat.h is semi-private, so this can be done.
Diffstat (limited to 'numpy')
50 files changed, 76 insertions, 67 deletions
diff --git a/numpy/core/include/numpy/npy_3kcompat.h b/numpy/core/include/numpy/npy_3kcompat.h index e771187e5..4b9d0ea32 100644 --- a/numpy/core/include/numpy/npy_3kcompat.h +++ b/numpy/core/include/numpy/npy_3kcompat.h @@ -137,25 +137,6 @@ PyUnicode_Concat2(PyObject **left, PyObject *right) *left = newobj; } - -/* - * Accessing items of ob_base - */ - -#if (PY_VERSION_HEX < 0x02060000) -#define Py_TYPE(o) (((PyObject*)(o))->ob_type) -#define Py_REFCNT(o) (((PyObject*)(o))->ob_refcnt) -#define Py_SIZE(o) (((PyVarObject*)(o))->ob_size) -#endif - -/* - * PyIndex_Check - */ -#if (PY_VERSION_HEX < 0x02050000) -#undef PyIndex_Check -#define PyIndex_Check(o) 0 -#endif - /* * PyFile_* compatibility */ diff --git a/numpy/core/src/dummymodule.c b/numpy/core/src/dummymodule.c index eca6edb54..1d48709e9 100644 --- a/numpy/core/src/dummymodule.c +++ b/numpy/core/src/dummymodule.c @@ -9,7 +9,7 @@ #define NPY_NO_DEPRECATED_API NPY_API_VERSION #include <Python.h> -#include <numpy/npy_3kcompat.h> +#include <npy_pycompat.h> static struct PyMethodDef methods[] = { {NULL, NULL, 0, NULL} diff --git a/numpy/core/src/multiarray/array_assign.c b/numpy/core/src/multiarray/array_assign.c index 03f81f21c..9c1685c16 100644 --- a/numpy/core/src/multiarray/array_assign.c +++ b/numpy/core/src/multiarray/array_assign.c @@ -16,7 +16,7 @@ #include <numpy/ndarraytypes.h> #include "npy_config.h" -#include "numpy/npy_3kcompat.h" +#include "npy_pycompat.h" #include "shape.h" diff --git a/numpy/core/src/multiarray/array_assign_array.c b/numpy/core/src/multiarray/array_assign_array.c index 98c2b19ff..4f462cb05 100644 --- a/numpy/core/src/multiarray/array_assign_array.c +++ b/numpy/core/src/multiarray/array_assign_array.c @@ -15,7 +15,7 @@ #include <numpy/ndarraytypes.h> #include "npy_config.h" -#include "numpy/npy_3kcompat.h" +#include "npy_pycompat.h" #include "convert_datatype.h" #include "methods.h" diff --git a/numpy/core/src/multiarray/array_assign_scalar.c b/numpy/core/src/multiarray/array_assign_scalar.c index c59e6752d..57f8b9074 100644 --- a/numpy/core/src/multiarray/array_assign_scalar.c +++ b/numpy/core/src/multiarray/array_assign_scalar.c @@ -15,7 +15,7 @@ #include <numpy/ndarraytypes.h> #include "npy_config.h" -#include "numpy/npy_3kcompat.h" +#include "npy_pycompat.h" #include "convert_datatype.h" #include "methods.h" diff --git a/numpy/core/src/multiarray/arrayobject.c b/numpy/core/src/multiarray/arrayobject.c index 3cba466dd..98af50865 100644 --- a/numpy/core/src/multiarray/arrayobject.c +++ b/numpy/core/src/multiarray/arrayobject.c @@ -32,7 +32,7 @@ maintainer email: oliphant.travis@ieee.org #include "npy_config.h" -#include "numpy/npy_3kcompat.h" +#include "npy_pycompat.h" #include "common.h" diff --git a/numpy/core/src/multiarray/arraytypes.c.src b/numpy/core/src/multiarray/arraytypes.c.src index c446619b6..ad45cdb9e 100644 --- a/numpy/core/src/multiarray/arraytypes.c.src +++ b/numpy/core/src/multiarray/arraytypes.c.src @@ -7,7 +7,7 @@ #define _MULTIARRAYMODULE #include "numpy/arrayobject.h" #include "numpy/arrayscalars.h" -#include "numpy/npy_3kcompat.h" +#include "npy_pycompat.h" #include "numpy/npy_math.h" #include "numpy/halffloat.h" diff --git a/numpy/core/src/multiarray/buffer.c b/numpy/core/src/multiarray/buffer.c index f9a7dddc0..530edbb1a 100644 --- a/numpy/core/src/multiarray/buffer.c +++ b/numpy/core/src/multiarray/buffer.c @@ -9,7 +9,7 @@ #include "npy_config.h" -#include "numpy/npy_3kcompat.h" +#include "npy_pycompat.h" #include "buffer.h" #include "numpyos.h" diff --git a/numpy/core/src/multiarray/calculation.c b/numpy/core/src/multiarray/calculation.c index d8d02ef0c..618a8714c 100644 --- a/numpy/core/src/multiarray/calculation.c +++ b/numpy/core/src/multiarray/calculation.c @@ -8,7 +8,7 @@ #include "npy_config.h" -#include "numpy/npy_3kcompat.h" +#include "npy_pycompat.h" #include "common.h" #include "number.h" diff --git a/numpy/core/src/multiarray/common.c b/numpy/core/src/multiarray/common.c index 9281a6d84..f62b37b4d 100644 --- a/numpy/core/src/multiarray/common.c +++ b/numpy/core/src/multiarray/common.c @@ -6,7 +6,7 @@ #include "numpy/arrayobject.h" #include "npy_config.h" -#include "numpy/npy_3kcompat.h" +#include "npy_pycompat.h" #include "usertypes.h" diff --git a/numpy/core/src/multiarray/conversion_utils.c b/numpy/core/src/multiarray/conversion_utils.c index ec759b85b..914bc274d 100644 --- a/numpy/core/src/multiarray/conversion_utils.c +++ b/numpy/core/src/multiarray/conversion_utils.c @@ -9,7 +9,7 @@ #include "numpy/arrayobject.h" #include "npy_config.h" -#include "numpy/npy_3kcompat.h" +#include "npy_pycompat.h" #include "common.h" #include "arraytypes.h" diff --git a/numpy/core/src/multiarray/convert.c b/numpy/core/src/multiarray/convert.c index 042aea07b..8b646e59b 100644 --- a/numpy/core/src/multiarray/convert.c +++ b/numpy/core/src/multiarray/convert.c @@ -9,7 +9,7 @@ #include "npy_config.h" -#include "numpy/npy_3kcompat.h" +#include "npy_pycompat.h" #include "arrayobject.h" #include "mapping.h" diff --git a/numpy/core/src/multiarray/convert_datatype.c b/numpy/core/src/multiarray/convert_datatype.c index 6fdb10bb2..de7468c51 100644 --- a/numpy/core/src/multiarray/convert_datatype.c +++ b/numpy/core/src/multiarray/convert_datatype.c @@ -9,7 +9,7 @@ #include "npy_config.h" -#include "numpy/npy_3kcompat.h" +#include "npy_pycompat.h" #include "common.h" #include "scalartypes.h" diff --git a/numpy/core/src/multiarray/ctors.c b/numpy/core/src/multiarray/ctors.c index 3da4c5294..ae29add6e 100644 --- a/numpy/core/src/multiarray/ctors.c +++ b/numpy/core/src/multiarray/ctors.c @@ -11,7 +11,7 @@ #include "npy_config.h" -#include "numpy/npy_3kcompat.h" +#include "npy_pycompat.h" #include "common.h" #include "ctors.h" diff --git a/numpy/core/src/multiarray/datetime.c b/numpy/core/src/multiarray/datetime.c index 55fb3e7ed..6f70fc2ff 100644 --- a/numpy/core/src/multiarray/datetime.c +++ b/numpy/core/src/multiarray/datetime.c @@ -18,7 +18,7 @@ #include <numpy/arrayobject.h> #include "npy_config.h" -#include "numpy/npy_3kcompat.h" +#include "npy_pycompat.h" #include "numpy/arrayscalars.h" #include "methods.h" diff --git a/numpy/core/src/multiarray/datetime_busday.c b/numpy/core/src/multiarray/datetime_busday.c index aa38594cb..331e10496 100644 --- a/numpy/core/src/multiarray/datetime_busday.c +++ b/numpy/core/src/multiarray/datetime_busday.c @@ -15,7 +15,7 @@ #include <numpy/arrayobject.h> #include "npy_config.h" -#include "numpy/npy_3kcompat.h" +#include "npy_pycompat.h" #include "numpy/arrayscalars.h" #include "lowlevel_strided_loops.h" diff --git a/numpy/core/src/multiarray/datetime_busdaycal.c b/numpy/core/src/multiarray/datetime_busdaycal.c index b5b74dd14..82eea9f20 100644 --- a/numpy/core/src/multiarray/datetime_busdaycal.c +++ b/numpy/core/src/multiarray/datetime_busdaycal.c @@ -16,7 +16,7 @@ #include <numpy/arrayobject.h> #include "npy_config.h" -#include "numpy/npy_3kcompat.h" +#include "npy_pycompat.h" #include "numpy/arrayscalars.h" #include "lowlevel_strided_loops.h" diff --git a/numpy/core/src/multiarray/datetime_strings.c b/numpy/core/src/multiarray/datetime_strings.c index cfeabc783..32009bb79 100644 --- a/numpy/core/src/multiarray/datetime_strings.c +++ b/numpy/core/src/multiarray/datetime_strings.c @@ -17,7 +17,7 @@ #include <numpy/arrayobject.h> #include "npy_config.h" -#include "numpy/npy_3kcompat.h" +#include "npy_pycompat.h" #include "numpy/arrayscalars.h" #include "methods.h" diff --git a/numpy/core/src/multiarray/descriptor.c b/numpy/core/src/multiarray/descriptor.c index 5090dc39c..596e9b837 100644 --- a/numpy/core/src/multiarray/descriptor.c +++ b/numpy/core/src/multiarray/descriptor.c @@ -11,7 +11,7 @@ #include "npy_config.h" -#include "numpy/npy_3kcompat.h" +#include "npy_pycompat.h" #include "_datetime.h" #include "common.h" diff --git a/numpy/core/src/multiarray/dtype_transfer.c b/numpy/core/src/multiarray/dtype_transfer.c index b99dd5ff4..138275c4c 100644 --- a/numpy/core/src/multiarray/dtype_transfer.c +++ b/numpy/core/src/multiarray/dtype_transfer.c @@ -19,7 +19,7 @@ #include <numpy/arrayobject.h> #include <numpy/npy_cpu.h> -#include "numpy/npy_3kcompat.h" +#include "npy_pycompat.h" #include "convert_datatype.h" #include "_datetime.h" diff --git a/numpy/core/src/multiarray/einsum.c.src b/numpy/core/src/multiarray/einsum.c.src index 03def17b4..2c59533f8 100644 --- a/numpy/core/src/multiarray/einsum.c.src +++ b/numpy/core/src/multiarray/einsum.c.src @@ -16,7 +16,7 @@ #define _MULTIARRAYMODULE #include <numpy/arrayobject.h> #include <numpy/halffloat.h> -#include <numpy/npy_3kcompat.h> +#include <npy_pycompat.h> #include <ctype.h> diff --git a/numpy/core/src/multiarray/flagsobject.c b/numpy/core/src/multiarray/flagsobject.c index 6e5455c01..faaf264e0 100644 --- a/numpy/core/src/multiarray/flagsobject.c +++ b/numpy/core/src/multiarray/flagsobject.c @@ -11,7 +11,7 @@ #include "npy_config.h" -#include "numpy/npy_3kcompat.h" +#include "npy_pycompat.h" #include "common.h" diff --git a/numpy/core/src/multiarray/getset.c b/numpy/core/src/multiarray/getset.c index 51caba240..32212ebc4 100644 --- a/numpy/core/src/multiarray/getset.c +++ b/numpy/core/src/multiarray/getset.c @@ -10,7 +10,7 @@ #include "npy_config.h" -#include "numpy/npy_3kcompat.h" +#include "npy_pycompat.h" #include "common.h" #include "scalartypes.h" diff --git a/numpy/core/src/multiarray/hashdescr.c b/numpy/core/src/multiarray/hashdescr.c index 71bc2adac..bff266415 100644 --- a/numpy/core/src/multiarray/hashdescr.c +++ b/numpy/core/src/multiarray/hashdescr.c @@ -6,7 +6,7 @@ #include "npy_config.h" -#include "numpy/npy_3kcompat.h" +#include "npy_pycompat.h" #include "hashdescr.h" diff --git a/numpy/core/src/multiarray/item_selection.c b/numpy/core/src/multiarray/item_selection.c index fe28f2482..8c80c26f1 100644 --- a/numpy/core/src/multiarray/item_selection.c +++ b/numpy/core/src/multiarray/item_selection.c @@ -11,7 +11,7 @@ #include "npy_config.h" -#include "numpy/npy_3kcompat.h" +#include "npy_pycompat.h" #include "common.h" #include "arrayobject.h" diff --git a/numpy/core/src/multiarray/iterators.c b/numpy/core/src/multiarray/iterators.c index af0d0d3c2..2e464a3db 100644 --- a/numpy/core/src/multiarray/iterators.c +++ b/numpy/core/src/multiarray/iterators.c @@ -9,7 +9,7 @@ #include "npy_config.h" -#include "numpy/npy_3kcompat.h" +#include "npy_pycompat.h" #include "arrayobject.h" #include "iterators.h" diff --git a/numpy/core/src/multiarray/mapping.c b/numpy/core/src/multiarray/mapping.c index 7abb3ff7f..cdefb9982 100644 --- a/numpy/core/src/multiarray/mapping.c +++ b/numpy/core/src/multiarray/mapping.c @@ -9,7 +9,7 @@ #include "npy_config.h" -#include "numpy/npy_3kcompat.h" +#include "npy_pycompat.h" #include "common.h" #include "iterators.h" diff --git a/numpy/core/src/multiarray/methods.c b/numpy/core/src/multiarray/methods.c index 93d246671..c4147eff2 100644 --- a/numpy/core/src/multiarray/methods.c +++ b/numpy/core/src/multiarray/methods.c @@ -10,7 +10,7 @@ #include "npy_config.h" -#include "numpy/npy_3kcompat.h" +#include "npy_pycompat.h" #include "common.h" #include "ctors.h" diff --git a/numpy/core/src/multiarray/multiarray_tests.c.src b/numpy/core/src/multiarray/multiarray_tests.c.src index a0f70aabc..0768ec0ca 100644 --- a/numpy/core/src/multiarray/multiarray_tests.c.src +++ b/numpy/core/src/multiarray/multiarray_tests.c.src @@ -2,7 +2,7 @@ #include <Python.h> #include "numpy/arrayobject.h" -#include "numpy/npy_3kcompat.h" +#include "npy_pycompat.h" /* * TODO: diff --git a/numpy/core/src/multiarray/multiarraymodule.c b/numpy/core/src/multiarray/multiarraymodule.c index 0180b1f89..1b9be3cd9 100644 --- a/numpy/core/src/multiarray/multiarraymodule.c +++ b/numpy/core/src/multiarray/multiarraymodule.c @@ -27,7 +27,7 @@ #include "npy_config.h" -#include "numpy/npy_3kcompat.h" +#include "npy_pycompat.h" NPY_NO_EXPORT int NPY_NUMUSERTYPES = 0; diff --git a/numpy/core/src/multiarray/nditer_impl.h b/numpy/core/src/multiarray/nditer_impl.h index bc4d01ff9..1251baa6e 100644 --- a/numpy/core/src/multiarray/nditer_impl.h +++ b/numpy/core/src/multiarray/nditer_impl.h @@ -17,7 +17,7 @@ #define NPY_NO_DEPRECATED_API NPY_API_VERSION #define _MULTIARRAYMODULE #include <numpy/arrayobject.h> -#include <numpy/npy_3kcompat.h> +#include <npy_pycompat.h> #include "convert_datatype.h" #include "lowlevel_strided_loops.h" diff --git a/numpy/core/src/multiarray/nditer_pywrap.c b/numpy/core/src/multiarray/nditer_pywrap.c index d6029e814..01291a0b4 100644 --- a/numpy/core/src/multiarray/nditer_pywrap.c +++ b/numpy/core/src/multiarray/nditer_pywrap.c @@ -13,11 +13,11 @@ #define NPY_NO_DEPRECATED_API NPY_API_VERSION #define _MULTIARRAYMODULE #include <numpy/arrayobject.h> -#include <numpy/npy_3kcompat.h> +#include <npy_pycompat.h> #include "npy_config.h" -#include "numpy/npy_3kcompat.h" +#include "npy_pycompat.h" typedef struct NewNpyArrayIterObject_tag NewNpyArrayIterObject; diff --git a/numpy/core/src/multiarray/number.c b/numpy/core/src/multiarray/number.c index 4cbf80df9..c37a232f4 100644 --- a/numpy/core/src/multiarray/number.c +++ b/numpy/core/src/multiarray/number.c @@ -9,7 +9,7 @@ #include "npy_config.h" -#include "numpy/npy_3kcompat.h" +#include "npy_pycompat.h" #include "number.h" diff --git a/numpy/core/src/multiarray/numpymemoryview.c b/numpy/core/src/multiarray/numpymemoryview.c index eda28e1af..991321a8c 100644 --- a/numpy/core/src/multiarray/numpymemoryview.c +++ b/numpy/core/src/multiarray/numpymemoryview.c @@ -16,7 +16,7 @@ #include "numpy/arrayscalars.h" #include "npy_config.h" -#include "numpy/npy_3kcompat.h" +#include "npy_pycompat.h" #include "numpymemoryview.h" diff --git a/numpy/core/src/multiarray/numpyos.c b/numpy/core/src/multiarray/numpyos.c index 9307a2473..cef170108 100644 --- a/numpy/core/src/multiarray/numpyos.c +++ b/numpy/core/src/multiarray/numpyos.c @@ -11,7 +11,7 @@ #include "npy_config.h" -#include "numpy/npy_3kcompat.h" +#include "npy_pycompat.h" /* * From the C99 standard, section 7.19.6: The exponent always contains at least diff --git a/numpy/core/src/multiarray/refcount.c b/numpy/core/src/multiarray/refcount.c index 2ba907f59..b067cd948 100644 --- a/numpy/core/src/multiarray/refcount.c +++ b/numpy/core/src/multiarray/refcount.c @@ -14,7 +14,7 @@ #include "npy_config.h" -#include "numpy/npy_3kcompat.h" +#include "npy_pycompat.h" static void _fillobject(char *optr, PyObject *obj, PyArray_Descr *dtype); diff --git a/numpy/core/src/multiarray/scalarapi.c b/numpy/core/src/multiarray/scalarapi.c index dd0e0158b..00c71f913 100644 --- a/numpy/core/src/multiarray/scalarapi.c +++ b/numpy/core/src/multiarray/scalarapi.c @@ -11,7 +11,7 @@ #include "npy_config.h" -#include "numpy/npy_3kcompat.h" +#include "npy_pycompat.h" #include "ctors.h" #include "descriptor.h" diff --git a/numpy/core/src/multiarray/scalartypes.c.src b/numpy/core/src/multiarray/scalartypes.c.src index 276937be1..e547071cc 100644 --- a/numpy/core/src/multiarray/scalartypes.c.src +++ b/numpy/core/src/multiarray/scalartypes.c.src @@ -13,7 +13,7 @@ #include "numpy/halffloat.h" #include "numpy/arrayscalars.h" -#include "numpy/npy_3kcompat.h" +#include "npy_pycompat.h" #include "npy_config.h" #include "mapping.h" diff --git a/numpy/core/src/multiarray/sequence.c b/numpy/core/src/multiarray/sequence.c index 5a43f0565..e5f74251e 100644 --- a/numpy/core/src/multiarray/sequence.c +++ b/numpy/core/src/multiarray/sequence.c @@ -9,7 +9,7 @@ #include "npy_config.h" -#include "numpy/npy_3kcompat.h" +#include "npy_pycompat.h" #include "common.h" #include "mapping.h" diff --git a/numpy/core/src/multiarray/shape.c b/numpy/core/src/multiarray/shape.c index 3ed46eac4..067232632 100644 --- a/numpy/core/src/multiarray/shape.c +++ b/numpy/core/src/multiarray/shape.c @@ -11,7 +11,7 @@ #include "npy_config.h" -#include "numpy/npy_3kcompat.h" +#include "npy_pycompat.h" #include "ctors.h" diff --git a/numpy/core/src/multiarray/ucsnarrow.c b/numpy/core/src/multiarray/ucsnarrow.c index 406b776bc..b0afdc6d9 100644 --- a/numpy/core/src/multiarray/ucsnarrow.c +++ b/numpy/core/src/multiarray/ucsnarrow.c @@ -12,7 +12,7 @@ #include "npy_config.h" -#include "numpy/npy_3kcompat.h" +#include "npy_pycompat.h" /* * Functions only needed on narrow builds of Python for converting back and diff --git a/numpy/core/src/multiarray/usertypes.c b/numpy/core/src/multiarray/usertypes.c index 92c8a1243..f69abcc6b 100644 --- a/numpy/core/src/multiarray/usertypes.c +++ b/numpy/core/src/multiarray/usertypes.c @@ -34,7 +34,7 @@ maintainer email: oliphant.travis@ieee.org #include "common.h" -#include "numpy/npy_3kcompat.h" +#include "npy_pycompat.h" #include "usertypes.h" diff --git a/numpy/core/src/private/npy_pycompat.h b/numpy/core/src/private/npy_pycompat.h new file mode 100644 index 000000000..6b49c7476 --- /dev/null +++ b/numpy/core/src/private/npy_pycompat.h @@ -0,0 +1,24 @@ +#ifndef _NPY_PYCOMPAT_H_ +#define _NPY_PYCOMPAT_H_ + +#include "numpy/npy_3kcompat.h" + +/* + * Accessing items of ob_base + */ + +#if (PY_VERSION_HEX < 0x02060000) +#define Py_TYPE(o) (((PyObject*)(o))->ob_type) +#define Py_REFCNT(o) (((PyObject*)(o))->ob_refcnt) +#define Py_SIZE(o) (((PyVarObject*)(o))->ob_size) +#endif + +/* + * PyIndex_Check + */ +#if (PY_VERSION_HEX < 0x02050000) +#undef PyIndex_Check +#define PyIndex_Check(o) 0 +#endif + +#endif /* _NPY_COMPAT_H_ */ diff --git a/numpy/core/src/scalarmathmodule.c.src b/numpy/core/src/scalarmathmodule.c.src index d9f7abc4e..4b56c1510 100644 --- a/numpy/core/src/scalarmathmodule.c.src +++ b/numpy/core/src/scalarmathmodule.c.src @@ -13,7 +13,7 @@ #include "numpy/ufuncobject.h" #include "numpy/arrayscalars.h" -#include "numpy/npy_3kcompat.h" +#include "npy_pycompat.h" #include "numpy/halffloat.h" diff --git a/numpy/core/src/umath/funcs.inc.src b/numpy/core/src/umath/funcs.inc.src index f3fefcfc5..6d46efc44 100644 --- a/numpy/core/src/umath/funcs.inc.src +++ b/numpy/core/src/umath/funcs.inc.src @@ -7,7 +7,7 @@ */ #define NPY_NO_DEPRECATED_API NPY_API_VERSION -#include "numpy/npy_3kcompat.h" +#include "npy_pycompat.h" /* diff --git a/numpy/core/src/umath/loops.c.src b/numpy/core/src/umath/loops.c.src index 7eede45d6..040486a32 100644 --- a/numpy/core/src/umath/loops.c.src +++ b/numpy/core/src/umath/loops.c.src @@ -16,7 +16,7 @@ #include "numpy/npy_math.h" #include "numpy/halffloat.h" -#include "numpy/npy_3kcompat.h" +#include "npy_pycompat.h" #include "ufunc_object.h" diff --git a/numpy/core/src/umath/ufunc_object.c b/numpy/core/src/umath/ufunc_object.c index 3e0306bd2..2712f0474 100644 --- a/numpy/core/src/umath/ufunc_object.c +++ b/numpy/core/src/umath/ufunc_object.c @@ -34,7 +34,7 @@ #define NO_IMPORT_ARRAY #endif -#include "numpy/npy_3kcompat.h" +#include "npy_pycompat.h" #include "numpy/arrayobject.h" #include "numpy/ufuncobject.h" diff --git a/numpy/core/src/umath/ufunc_type_resolution.c b/numpy/core/src/umath/ufunc_type_resolution.c index da1b2e811..372edc07a 100644 --- a/numpy/core/src/umath/ufunc_type_resolution.c +++ b/numpy/core/src/umath/ufunc_type_resolution.c @@ -19,7 +19,7 @@ #define NO_IMPORT_ARRAY #endif -#include "numpy/npy_3kcompat.h" +#include "npy_pycompat.h" #include "numpy/ufuncobject.h" #include "ufunc_type_resolution.h" diff --git a/numpy/core/src/umath/umath_tests.c.src b/numpy/core/src/umath/umath_tests.c.src index 43583d119..0ba13f15f 100644 --- a/numpy/core/src/umath/umath_tests.c.src +++ b/numpy/core/src/umath/umath_tests.c.src @@ -11,7 +11,7 @@ #include "numpy/arrayobject.h" #include "numpy/ufuncobject.h" -#include "numpy/npy_3kcompat.h" +#include "npy_pycompat.h" #include "npy_config.h" diff --git a/numpy/lib/src/_compiled_base.c b/numpy/lib/src/_compiled_base.c index 9bb8a613d..d389b7f8e 100644 --- a/numpy/lib/src/_compiled_base.c +++ b/numpy/lib/src/_compiled_base.c @@ -7,6 +7,10 @@ #include "numpy/ufuncobject.h" #include "string.h" +#if (PY_VERSION_HEX < 0x02060000) +#define Py_TYPE(o) (((PyObject*)(o))->ob_type) +#endif + static npy_intp incr_slot_(double x, double *bins, npy_intp lbins) { |