summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authormattip <matti.picus@gmail.com>2023-02-07 12:04:45 +0200
committermattip <matti.picus@gmail.com>2023-02-07 12:04:45 +0200
commitb80bc2d324ddbbb1fae7e690c641b62c3923ddcf (patch)
treeb55c3c0b09aaa57dddecd3bd1385f4ab9724da7a /numpy
parentf79325e70e1a79e1fdda9edfcdebd78048e67d2c (diff)
downloadnumpy-b80bc2d324ddbbb1fae7e690c641b62c3923ddcf.tar.gz
ENH: fixes from review
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/src/umath/ufunc_object.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/numpy/core/src/umath/ufunc_object.c b/numpy/core/src/umath/ufunc_object.c
index 60efdce96..35fb2aea5 100644
--- a/numpy/core/src/umath/ufunc_object.c
+++ b/numpy/core/src/umath/ufunc_object.c
@@ -5920,6 +5920,10 @@ trivial_at_loop(PyArrayMethodObject *ufuncimpl, NPY_ARRAYMETHOD_FLAGS flags,
npy_intp *inner_size = NpyIter_GetInnerLoopSizePtr(iter->outer);
+ if (!(flags & NPY_METH_NO_FLOATINGPOINT_ERRORS)) {
+ npy_clear_floatstatus_barrier((char *)context);
+ }
+
do {
args[1] = (char *) iter->outer_ptrs[0];
steps[1] = iter->outer_strides[0];
@@ -5927,14 +5931,6 @@ trivial_at_loop(PyArrayMethodObject *ufuncimpl, NPY_ARRAYMETHOD_FLAGS flags,
res = ufuncimpl->contiguous_indexed_loop(
context, args, inner_size, steps, NULL);
} while (res == 0 && iter->outer_next(iter->outer));
- /*
- * An error should only be possible if `res != 0` is already set.
- * But this is not strictly correct since old-style ufuncs (e.g. `power`
- * released the GIL but manually set an Exception).
- */
- if (PyErr_Occurred()) {
- res = -1;
- }
if (res == 0 && !(flags & NPY_METH_NO_FLOATINGPOINT_ERRORS)) {
const char * ufunc_name =
@@ -6355,10 +6351,6 @@ ufunc_at(PyUFuncObject *ufunc, PyObject *args)
}
}
- /*
- * Create a map iterator (there is no multi-mapiter, so we need at least 2
- * iterators: one for the mapping, and another for the second operand)
- */
iter = (PyArrayMapIterObject *)PyArray_MapIterArrayCopyIfOverlap(
op1_array, idx, 1, op2_array);
if (iter == NULL) {