summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--numpy/core/code_generators/generate_numpy_api.py2
-rw-r--r--numpy/core/code_generators/generate_ufunc_api.py2
-rw-r--r--numpy/core/include/numpy/ndarraytypes.h2
-rw-r--r--numpy/core/include/numpy/npy_3kcompat.h2
-rw-r--r--numpy/core/src/multiarray/scalartypes.c.src2
-rw-r--r--numpy/core/src/multiarray/scalartypes.h2
-rw-r--r--numpy/core/src/umath/ufunc_object.c3
-rw-r--r--numpy/f2py/src/fortranobject.c4
-rw-r--r--numpy/f2py/src/fortranobject.h2
-rw-r--r--numpy/lib/type_check.py2
-rw-r--r--numpy/numarray/_capi.c2
-rw-r--r--numpy/numarray/include/numpy/libnumarray.h2
-rw-r--r--numpy/random/mtrand/Python.pxi2
13 files changed, 14 insertions, 15 deletions
diff --git a/numpy/core/code_generators/generate_numpy_api.py b/numpy/core/code_generators/generate_numpy_api.py
index 962007afc..2f4316d17 100644
--- a/numpy/core/code_generators/generate_numpy_api.py
+++ b/numpy/core/code_generators/generate_numpy_api.py
@@ -63,7 +63,7 @@ _import_array(void)
return -1;
}
-#if PY_VERSION_HEX >= 0x02070000
+#if PY_VERSION_HEX >= 0x03000000
if (!PyCapsule_CheckExact(c_api)) {
PyErr_SetString(PyExc_RuntimeError, "_ARRAY_API is not PyCapsule object");
Py_DECREF(c_api);
diff --git a/numpy/core/code_generators/generate_ufunc_api.py b/numpy/core/code_generators/generate_ufunc_api.py
index 2559ff774..e6e50c2fe 100644
--- a/numpy/core/code_generators/generate_ufunc_api.py
+++ b/numpy/core/code_generators/generate_ufunc_api.py
@@ -52,7 +52,7 @@ _import_umath(void)
return -1;
}
-#if PY_VERSION_HEX >= 0x02070000
+#if PY_VERSION_HEX >= 0x03000000
if (!PyCapsule_CheckExact(c_api)) {
PyErr_SetString(PyExc_RuntimeError, "_UFUNC_API is not PyCapsule object");
Py_DECREF(c_api);
diff --git a/numpy/core/include/numpy/ndarraytypes.h b/numpy/core/include/numpy/ndarraytypes.h
index cd9ec9993..a86c3f62d 100644
--- a/numpy/core/include/numpy/ndarraytypes.h
+++ b/numpy/core/include/numpy/ndarraytypes.h
@@ -658,7 +658,7 @@ typedef struct {
int sec, us, ps, as;
} npy_timedeltastruct;
-#if PY_VERSION_HEX >= 0x02070000
+#if PY_VERSION_HEX >= 0x03000000
#define PyDataType_GetDatetimeMetaData(descr) \
((descr->metadata == NULL) ? NULL : \
((PyArray_DatetimeMetaData *)(PyCapsule_GetPointer( \
diff --git a/numpy/core/include/numpy/npy_3kcompat.h b/numpy/core/include/numpy/npy_3kcompat.h
index 9f53dd9d2..831941f12 100644
--- a/numpy/core/include/numpy/npy_3kcompat.h
+++ b/numpy/core/include/numpy/npy_3kcompat.h
@@ -237,7 +237,7 @@ PyObject_Cmp(PyObject *i1, PyObject *i2, int *cmp)
* The main job here is to get rid of the improved error handling
* of PyCapsules. It's a shame...
*/
-#if PY_VERSION_HEX >= 0x02070000
+#if PY_VERSION_HEX >= 0x03000000
static NPY_INLINE PyObject *
NpyCapsule_FromVoidPtr(void *ptr, void (*dtor)(PyObject *))
diff --git a/numpy/core/src/multiarray/scalartypes.c.src b/numpy/core/src/multiarray/scalartypes.c.src
index fa5bc3c27..d57cf45ce 100644
--- a/numpy/core/src/multiarray/scalartypes.c.src
+++ b/numpy/core/src/multiarray/scalartypes.c.src
@@ -810,7 +810,7 @@ gentype_size_get(PyObject *NPY_UNUSED(self))
return PyInt_FromLong(1);
}
-#if PY_VERSION_HEX >= 0x02070000
+#if PY_VERSION_HEX >= 0x03000000
NPY_NO_EXPORT void
gentype_struct_free(PyObject *ptr)
{
diff --git a/numpy/core/src/multiarray/scalartypes.h b/numpy/core/src/multiarray/scalartypes.h
index ce3b1ca2c..893c0051d 100644
--- a/numpy/core/src/multiarray/scalartypes.h
+++ b/numpy/core/src/multiarray/scalartypes.h
@@ -7,7 +7,7 @@ initialize_numeric_types(void);
NPY_NO_EXPORT void
format_longdouble(char *buf, size_t buflen, longdouble val, unsigned int prec);
-#if PY_VERSION_HEX >= 0x02070000
+#if PY_VERSION_HEX >= 0x03000000
NPY_NO_EXPORT void
gentype_struct_free(PyObject *ptr);
#else
diff --git a/numpy/core/src/umath/ufunc_object.c b/numpy/core/src/umath/ufunc_object.c
index a39b69212..be38a9f10 100644
--- a/numpy/core/src/umath/ufunc_object.c
+++ b/numpy/core/src/umath/ufunc_object.c
@@ -3887,14 +3887,13 @@ _free_loop1d_list(PyUFunc_Loop1d *data)
}
}
-#if PY_VERSION_HEX >= 0x02070000
+#if PY_VERSION_HEX >= 0x03000000
static void
_loop1d_list_free(PyObject *ptr)
{
PyUFunc_Loop1d *data = (PyUFunc_Loop1d *)PyCapsule_GetPointer(ptr, NULL);
_free_loop1d_list(data);
}
-
#else
static void
_loop1d_list_free(void *ptr)
diff --git a/numpy/f2py/src/fortranobject.c b/numpy/f2py/src/fortranobject.c
index 05ecd1383..ff80fa7e5 100644
--- a/numpy/f2py/src/fortranobject.c
+++ b/numpy/f2py/src/fortranobject.c
@@ -914,10 +914,10 @@ int copy_ND_array(const PyArrayObject *arr, PyArrayObject *out)
}
/*********************************************/
-/* Compatibility functions for Python >= 2.7 */
+/* Compatibility functions for Python >= 3.0 */
/*********************************************/
-#if PY_VERSION_HEX >= 0X02070000
+#if PY_VERSION_HEX >= 0x03000000
PyObject *
F2PyCapsule_FromVoidPtr(void *ptr, void (*dtor)(PyObject *))
diff --git a/numpy/f2py/src/fortranobject.h b/numpy/f2py/src/fortranobject.h
index e4ebc4664..283021aa1 100644
--- a/numpy/f2py/src/fortranobject.h
+++ b/numpy/f2py/src/fortranobject.h
@@ -121,7 +121,7 @@ typedef struct {
extern PyObject * PyFortranObject_New(FortranDataDef* defs, f2py_void_func init);
extern PyObject * PyFortranObject_NewAsAttr(FortranDataDef* defs);
-#if PY_VERSION_HEX >= 0x02070000
+#if PY_VERSION_HEX >= 0x03000000
PyObject * F2PyCapsule_FromVoidPtr(void *ptr, void (*dtor)(PyObject *));
void * F2PyCapsule_AsVoidPtr(PyObject *obj);
diff --git a/numpy/lib/type_check.py b/numpy/lib/type_check.py
index 5db65a3c5..24701574a 100644
--- a/numpy/lib/type_check.py
+++ b/numpy/lib/type_check.py
@@ -620,7 +620,7 @@ def datetime_data(dtype):
('events', ctypes.c_int)]
import sys
- if sys.version_info[:2] >= (2,7):
+ if sys.version_info[:2] >= (3, 0):
func = ctypes.pythonapi.PyCapsule_GetPointer
func.argtypes = [ctypes.py_object, ctypes.c_char_p]
func.restype = ctypes.c_void_p
diff --git a/numpy/numarray/_capi.c b/numpy/numarray/_capi.c
index 1387404b7..56e291055 100644
--- a/numpy/numarray/_capi.c
+++ b/numpy/numarray/_capi.c
@@ -3408,7 +3408,7 @@ PyMODINIT_FUNC init_capi(void)
m = Py_InitModule("_capi", _libnumarrayMethods);
#endif
-#if PY_VERSION_HEX >= 0x02070000
+#if PY_VERSION_HEX >= 0x03000000
c_api_object = PyCapsule_New((void *)libnumarray_API, NULL, NULL);
if (c_api_object == NULL) {
PyErr_Clear();
diff --git a/numpy/numarray/include/numpy/libnumarray.h b/numpy/numarray/include/numpy/libnumarray.h
index 08fe159f7..c69f10d8e 100644
--- a/numpy/numarray/include/numpy/libnumarray.h
+++ b/numpy/numarray/include/numpy/libnumarray.h
@@ -40,7 +40,7 @@ static void **libnumarray_API;
#endif
#endif
-#if PY_VERSION_HEX >= 0x02070000
+#if PY_VERSION_HEX >= 0x03000000
#define _import_libnumarray() \
{ \
PyObject *module = PyImport_ImportModule("numpy.numarray._capi"); \
diff --git a/numpy/random/mtrand/Python.pxi b/numpy/random/mtrand/Python.pxi
index 2f7adf096..01d47af50 100644
--- a/numpy/random/mtrand/Python.pxi
+++ b/numpy/random/mtrand/Python.pxi
@@ -30,7 +30,7 @@ cdef extern from "Python.h":
# CObject API
# If this is uncommented it needs to be fixed to use PyCapsule
-# for Python >= 2.7
+# for Python >= 3.0
#
# ctypedef void (*destructor1)(void* cobj)
# ctypedef void (*destructor2)(void* cobj, void* desc)