From e1c91c74297b39a19e7d58aa0abaa32b23ddf446 Mon Sep 17 00:00:00 2001 From: Charles Harris Date: Sun, 8 Mar 2009 20:47:25 +0000 Subject: Apply patch from Darren Dale to fix __array_wrap__ problem. --- numpy/core/src/umath_ufunc_object.inc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'numpy/core/src') diff --git a/numpy/core/src/umath_ufunc_object.inc b/numpy/core/src/umath_ufunc_object.inc index 288d5c99c..0ef8d3530 100644 --- a/numpy/core/src/umath_ufunc_object.inc +++ b/numpy/core/src/umath_ufunc_object.inc @@ -3147,7 +3147,6 @@ _find_array_wrap(PyObject *args, PyObject **output_wrap, int nin, int nout) Py_ssize_t nargs; int i; int np = 0; - double priority, maxpriority; PyObject *with_wrap[NPY_MAXARGS], *wraps[NPY_MAXARGS]; PyObject *obj, *wrap = NULL; @@ -3173,12 +3172,14 @@ _find_array_wrap(PyObject *args, PyObject **output_wrap, int nin, int nout) PyErr_Clear(); } } - if (np >= 2) { + if (np >= 1) { wrap = wraps[0]; - maxpriority = PyArray_GetPriority(with_wrap[0], + } + if (np >= 2) { + double maxpriority = PyArray_GetPriority(with_wrap[0], PyArray_SUBTYPE_PRIORITY); for (i = 1; i < np; ++i) { - priority = PyArray_GetPriority(with_wrap[i], + double priority = PyArray_GetPriority(with_wrap[i], PyArray_SUBTYPE_PRIORITY); if (priority > maxpriority) { maxpriority = priority; -- cgit v1.2.1