diff options
author | Eric Wieser <wieser.eric@gmail.com> | 2017-05-09 17:40:05 +0100 |
---|---|---|
committer | Eric Wieser <wieser.eric@gmail.com> | 2017-05-09 17:40:05 +0100 |
commit | 59fbc7d17a9e3a29ea7359891bd52b84cabb670f (patch) | |
tree | e8a7f6e8b2995598f06afccad26c006931d511e1 | |
parent | 00f77106275986b155d2b71ce672225792a07d87 (diff) | |
download | python-numpy-59fbc7d17a9e3a29ea7359891bd52b84cabb670f.tar.gz python-numpy-59fbc7d17a9e3a29ea7359891bd52b84cabb670f.tar.bz2 python-numpy-59fbc7d17a9e3a29ea7359891bd52b84cabb670f.zip |
BUG: Don't silence errors in bool(object_array)
Fixes #9078
-rw-r--r-- | numpy/core/src/multiarray/number.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/numpy/core/src/multiarray/number.c b/numpy/core/src/multiarray/number.c index e0acff8b8..1f5523b90 100644 --- a/numpy/core/src/multiarray/number.c +++ b/numpy/core/src/multiarray/number.c @@ -794,6 +794,10 @@ _array_nonzero(PyArrayObject *mp) return -1; } res = PyArray_DESCR(mp)->f->nonzero(PyArray_DATA(mp), mp); + /* nonzero has no way to indicate an error, but one can occur */ + if (PyErr_Occurred()) { + res = -1; + } Py_LeaveRecursiveCall(); return res; } |