diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2015-04-23 19:10:32 -0400 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2015-04-23 19:10:32 -0400 |
commit | 98a9daeed84ea886c7994f2c179b0768356164a0 (patch) | |
tree | 45d9a3e729a07d2517fe2450a24ebad3ff505ac1 | |
parent | 9d7beb16041bc4d7d458dbe000905b4e9956c01b (diff) | |
parent | d73f23b092c3b44c279412c4833eb6bd953b713a (diff) | |
download | numpy-98a9daeed84ea886c7994f2c179b0768356164a0.tar.gz |
Merge pull request #5785 from jaimefrio/compiler_warnings
BUG: Fixed wrong return of PyArray_Partition on failure
-rw-r--r-- | numpy/core/src/multiarray/item_selection.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/core/src/multiarray/item_selection.c b/numpy/core/src/multiarray/item_selection.c index c59a125e0..877887109 100644 --- a/numpy/core/src/multiarray/item_selection.c +++ b/numpy/core/src/multiarray/item_selection.c @@ -1230,7 +1230,7 @@ PyArray_Partition(PyArrayObject *op, PyArrayObject * ktharray, int axis, if (which < 0 || which >= NPY_NSELECTS) { PyErr_SetString(PyExc_ValueError, "not a valid partition kind"); - return NULL; + return -1; } part = get_partition_func(PyArray_TYPE(op), which); if (part == NULL) { @@ -1241,7 +1241,7 @@ PyArray_Partition(PyArrayObject *op, PyArrayObject * ktharray, int axis, else { PyErr_SetString(PyExc_TypeError, "type does not have compare function"); - return NULL; + return -1; } } |