@@ -5944,15 +5944,15 @@ new_array_op(PyArrayObject *op_array, char *data)
59445944}
59455945
59465946int is_generic_wrapped_legacy_loop (PyArrayMethod_StridedLoop * strided_loop );
5947+ PyUFuncGenericFunction get_inner_loop (void * auxdata );
5948+ int get_pyerr_check (void * auxdata );
59475949
59485950static int
59495951ufunc_at__fast_iter (PyUFuncObject * ufunc , NPY_ARRAYMETHOD_FLAGS flags ,
59505952 PyArrayMapIterObject * iter , PyArrayIterObject * iter2 ,
59515953 PyArrayObject * op1_array , PyArrayObject * op2_array ,
5952- PyArrayMethod_StridedLoop * strided_loop ,
5953- PyArrayMethod_Context * context ,
5954- npy_intp strides [3 ],
5955- NpyAuxData * auxdata
5954+ PyUFuncGenericFunction loop , int pyerr_check ,
5955+ npy_intp strides [3 ]
59565956 )
59575957{
59585958 int buffersize ;
@@ -5998,8 +5998,9 @@ ufunc_at__fast_iter(PyUFuncObject *ufunc, NPY_ARRAYMETHOD_FLAGS flags,
59985998 dataptr [2 ] = NULL ;
59995999 }
60006000
6001- res = strided_loop (context , dataptr , & count , strides , auxdata );
6002- if (res != 0 ) {
6001+ loop (dataptr , & count , strides , NULL );
6002+ if (pyerr_check && PyErr_Occurred ()) {
6003+ res = -1 ;
60036004 break ;
60046005 }
60056006
@@ -6435,8 +6436,10 @@ ufunc_at(PyUFuncObject *ufunc, PyObject *args)
64356436 }
64366437 }
64376438 if (fast_path ) {
6438- res = ufunc_at__fast_iter (ufunc , flags , iter , iter2 , op1_array , op2_array ,
6439- strided_loop , & context , strides , auxdata );
6439+ PyUFuncGenericFunction loop = get_inner_loop (auxdata );
6440+
6441+ res = ufunc_at__fast_iter (ufunc , flags , iter , iter2 , op1_array ,
6442+ op2_array , loop , get_pyerr_check (auxdata ), strides );
64406443 } else {
64416444 res = ufunc_at__slow_iter (ufunc , flags , iter , iter2 , op1_array , op2_array ,
64426445 operation_descrs , strided_loop , & context , strides , auxdata );
0 commit comments