Skip to content

Commit

Permalink
wrong error check
Browse files Browse the repository at this point in the history
  • Loading branch information
jsalvatier committed Nov 20, 2012
1 parent b86deb7 commit 14c7faa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions numpy/core/src/multiarray/mapping.c
Expand Up @@ -1064,7 +1064,7 @@ array_subscript(PyArrayObject *self, PyObject *op)
Py_DECREF(mit);
return rval;
}
if (!PyArray_MapIterBind(mit, self)) {
if (PyArray_MapIterBind(mit, self) != 0) {
return NULL;
}
other = (PyArrayObject *)PyArray_GetMap(mit);
Expand Down Expand Up @@ -1330,7 +1330,7 @@ array_ass_sub(PyArrayObject *self, PyObject *ind, PyObject *op)
Py_DECREF(mit);
return rval;
}
if (!PyArray_MapIterBind(mit, self)) {
if (PyArray_MapIterBind(mit, self) != 0) {
return -1;
}
ret = PyArray_SetMap(mit, op);
Expand Down Expand Up @@ -1720,7 +1720,7 @@ PyArray_MapIterBind(PyArrayMapIterObject *mit, PyArrayObject *arr)

mit->ait = (PyArrayIterObject *)PyArray_IterNew((PyObject *)arr);
if (mit->ait == NULL) {
return 0;
return 1;
}
/* no subspace iteration needed. Finish up and Return */
if (subnd == 0) {
Expand Down Expand Up @@ -2051,7 +2051,7 @@ PyArray_MapIterArray(PyArrayObject * a, PyObject * index)
return NULL;
}

if (!PyArray_MapIterBind(mit, a)) {
if (PyArray_MapIterBind(mit, a) != 0) {
return NULL;
}
PyArray_MapIterReset(mit);
Expand Down
2 changes: 1 addition & 1 deletion numpy/core/src/multiarray/mapping.h
Expand Up @@ -53,7 +53,7 @@ PyArray_MapIterReset(PyArrayMapIterObject *mit);
NPY_NO_EXPORT void
PyArray_MapIterNext(PyArrayMapIterObject *mit);

NPY_NO_EXPORT void
NPY_NO_EXPORT int
PyArray_MapIterBind(PyArrayMapIterObject *, PyArrayObject *);

NPY_NO_EXPORT PyObject*
Expand Down

0 comments on commit 14c7faa

Please sign in to comment.