summaryrefslogtreecommitdiff
path: root/tools/swig
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2015-10-31 11:52:09 -0600
committerCharles Harris <charlesr.harris@gmail.com>2015-11-01 17:37:09 -0700
commitb9ef15c4ece1e74d315289584fe33e98bd0c5633 (patch)
tree90e7fdbfe3078e71377a9d280ef141446835ad2a /tools/swig
parent629d4081ad29db2f77a2b5f0fc00f434daacf7b1 (diff)
downloadpython-numpy-b9ef15c4ece1e74d315289584fe33e98bd0c5633.tar.gz
python-numpy-b9ef15c4ece1e74d315289584fe33e98bd0c5633.tar.bz2
python-numpy-b9ef15c4ece1e74d315289584fe33e98bd0c5633.zip
BUG: Fix use of PyArray_ISFORTRAN in numpy.i.
PyArray_ISFORTRAN was used to implement array_is_fortran in numpy.i when what was wanted was PyArray_IS_F_CONTIGUOUS. The difference is that PyArray_ISFORTRAN will return False if the array is c_contiguous. Previous to relaxed stride checking this did not matter, but currently arrays with ndim > 1 may be both C and Fortran contiguous and that results in errors when PyArray_ISFORTRAN is mistakenly used to check for Fortran contiguity.
Diffstat (limited to 'tools/swig')
-rw-r--r--tools/swig/numpy.i2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/swig/numpy.i b/tools/swig/numpy.i
index 2ddc11de7..11fcd42fe 100644
--- a/tools/swig/numpy.i
+++ b/tools/swig/numpy.i
@@ -96,7 +96,7 @@
%#endif
%#define array_is_contiguous(a) (PyArray_ISCONTIGUOUS((PyArrayObject*)a))
%#define array_is_native(a) (PyArray_ISNOTSWAPPED((PyArrayObject*)a))
-%#define array_is_fortran(a) (PyArray_ISFORTRAN((PyArrayObject*)a))
+%#define array_is_fortran(a) (PyArray_IS_F_CONTIGUOUS((PyArrayObject*)a))
}
/**********************************************************************/