From bc656ee7cb00a6c4ad0d43f1cdd36bf8c9a026ed Mon Sep 17 00:00:00 2001 From: Charles Harris Date: Mon, 3 May 2010 07:50:02 +0000 Subject: ENH, BUG: PyCObject will be deprecated in python 2.7. So use the NpyCapsule compatibility functions in npy_3kcompat.h to replace the current calls. This gets rid of a number of version checks and is easier to maintain. Fix bug that was present in the ufunc _loop1d_list_free destructor in the python3k case. --- numpy/f2py/src/fortranobject.c | 8 ++++---- numpy/f2py/src/fortranobject.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'numpy/f2py') diff --git a/numpy/f2py/src/fortranobject.c b/numpy/f2py/src/fortranobject.c index 1cd3d3f31..05ecd1383 100644 --- a/numpy/f2py/src/fortranobject.c +++ b/numpy/f2py/src/fortranobject.c @@ -913,11 +913,11 @@ int copy_ND_array(const PyArrayObject *arr, PyArrayObject *out) return PyArray_CopyInto(out, (PyArrayObject *)arr); } -/*******************************************/ -/* Compatibility functions for Python 3.1 */ -/*******************************************/ +/*********************************************/ +/* Compatibility functions for Python >= 2.7 */ +/*********************************************/ -#if PY_VERSION_HEX >= 0X03010000 +#if PY_VERSION_HEX >= 0X02070000 PyObject * F2PyCapsule_FromVoidPtr(void *ptr, void (*dtor)(PyObject *)) diff --git a/numpy/f2py/src/fortranobject.h b/numpy/f2py/src/fortranobject.h index 54a386514..e4ebc4664 100644 --- a/numpy/f2py/src/fortranobject.h +++ b/numpy/f2py/src/fortranobject.h @@ -76,7 +76,7 @@ extern "C" { 123456789-123456789-123456789-123456789-123456789-123456789-123456789-12 PyFortranObject represents various Fortran objects: -Fortran (module) routines, COMMON blocks, module data. +Fortran (module) routines, COMMON blocks, module data. Author: Pearu Peterson */ @@ -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 >= 0x03010000 +#if PY_VERSION_HEX >= 0x02070000 PyObject * F2PyCapsule_FromVoidPtr(void *ptr, void (*dtor)(PyObject *)); void * F2PyCapsule_AsVoidPtr(PyObject *obj); -- cgit v1.2.1