summaryrefslogtreecommitdiff
path: root/numpy/core/src/arrayobject.c
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2008-03-22 03:06:28 +0000
committerTravis Oliphant <oliphant@enthought.com>2008-03-22 03:06:28 +0000
commitdd868d86c0080a2f73341fdd8da960c2af6318d9 (patch)
treed02706ef5b3f326557cfbdd800e200414a60f167 /numpy/core/src/arrayobject.c
parent3ee085282a5d5601ce310d56e3e4688a6872fc40 (diff)
downloadnumpy-dd868d86c0080a2f73341fdd8da960c2af6318d9.tar.gz
Fix ticket #702 (as well as other speed ups).
Diffstat (limited to 'numpy/core/src/arrayobject.c')
-rw-r--r--numpy/core/src/arrayobject.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/numpy/core/src/arrayobject.c b/numpy/core/src/arrayobject.c
index 3e11d3c3a..461422325 100644
--- a/numpy/core/src/arrayobject.c
+++ b/numpy/core/src/arrayobject.c
@@ -7773,7 +7773,7 @@ PyArray_CastTo(PyArrayObject *out, PyArrayObject *mp)
NPY_BEGIN_THREADS_DEF
- if (mpsize == 0) return 0;
+ if (mpsize == 0) return 0;
if (!PyArray_ISWRITEABLE(out)) {
PyErr_SetString(PyExc_ValueError,
"output array is not writeable");
@@ -7800,7 +7800,8 @@ PyArray_CastTo(PyArrayObject *out, PyArrayObject *mp)
if (PyArray_ISNUMBER(mp) && PyArray_ISNUMBER(out)) {
NPY_END_THREADS }
#endif
- if (!PyArray_ISNUMBER(mp) && PyErr_Occurred()) return -1;
+ if (PyErr_Occurred()) return -1;
+ return 0;
}
/* If the input or output is OBJECT, STRING, UNICODE, or VOID */