diff options
author | Eric Wieser <wieser.eric@gmail.com> | 2020-08-24 09:19:08 +0100 |
---|---|---|
committer | Eric Wieser <wieser.eric@gmail.com> | 2020-08-24 09:21:19 +0100 |
commit | 117b3f4a293c689777d3cd445969ca99acb01cfe (patch) | |
tree | 0619443620f88ec5efd35064adf944564527cb29 /numpy/f2py/tests/src/array_from_pyobj | |
parent | 64619c55896dad1927afe78c0702a58abf0d038f (diff) | |
download | numpy-117b3f4a293c689777d3cd445969ca99acb01cfe.tar.gz |
MAINT: Replace PyInt macros with their PyLong replacement
Unlike the others, PyInt_Check has a special meaning distinc from PyLong_Check, so only the places where the difference doesn't matter have been updated here.
Diffstat (limited to 'numpy/f2py/tests/src/array_from_pyobj')
-rw-r--r-- | numpy/f2py/tests/src/array_from_pyobj/wrapmodule.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/numpy/f2py/tests/src/array_from_pyobj/wrapmodule.c b/numpy/f2py/tests/src/array_from_pyobj/wrapmodule.c index 0db33e714..8b089d334 100644 --- a/numpy/f2py/tests/src/array_from_pyobj/wrapmodule.c +++ b/numpy/f2py/tests/src/array_from_pyobj/wrapmodule.c @@ -55,7 +55,7 @@ static PyObject *f2py_rout_wrap_call(PyObject *capi_self, if (tmp == NULL) { goto fail; } - dims[i] = (npy_intp)PyInt_AsLong(tmp); + dims[i] = (npy_intp)PyLong_AsLong(tmp); Py_DECREF(tmp); if (dims[i] == -1 && PyErr_Occurred()) { goto fail; @@ -107,8 +107,8 @@ static PyObject *f2py_rout_wrap_attrs(PyObject *capi_self, dimensions = PyTuple_New(PyArray_NDIM(arr)); strides = PyTuple_New(PyArray_NDIM(arr)); for (i=0;i<PyArray_NDIM(arr);++i) { - PyTuple_SetItem(dimensions,i,PyInt_FromLong(PyArray_DIM(arr,i))); - PyTuple_SetItem(strides,i,PyInt_FromLong(PyArray_STRIDE(arr,i))); + PyTuple_SetItem(dimensions,i,PyLong_FromLong(PyArray_DIM(arr,i))); + PyTuple_SetItem(strides,i,PyLong_FromLong(PyArray_STRIDE(arr,i))); } return Py_BuildValue("siNNO(cciii)ii",s,PyArray_NDIM(arr), dimensions,strides, @@ -157,7 +157,7 @@ PyMODINIT_FUNC PyInit_test_array_from_pyobj_ext(void) { Py_DECREF(s); #define ADDCONST(NAME, CONST) \ - s = PyInt_FromLong(CONST); \ + s = PyLong_FromLong(CONST); \ PyDict_SetItemString(d, NAME, s); \ Py_DECREF(s) |