summaryrefslogtreecommitdiff
path: root/numpy/core/src
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2009-03-08 20:47:25 +0000
committerCharles Harris <charlesr.harris@gmail.com>2009-03-08 20:47:25 +0000
commite1c91c74297b39a19e7d58aa0abaa32b23ddf446 (patch)
tree278f9a2a9db503206c80677098ed57f2e3526047 /numpy/core/src
parent919f279380b39ba41ad220fe82a430b6093857a5 (diff)
downloadnumpy-e1c91c74297b39a19e7d58aa0abaa32b23ddf446.tar.gz
Apply patch from Darren Dale to fix __array_wrap__ problem.
Diffstat (limited to 'numpy/core/src')
-rw-r--r--numpy/core/src/umath_ufunc_object.inc9
1 files changed, 5 insertions, 4 deletions
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;