From f48abc5a5b88e22dbbad44b1cb130543231ffa13 Mon Sep 17 00:00:00 2001 From: Charles Harris Date: Wed, 16 Jul 2008 20:23:29 +0000 Subject: Fix ticket #850. Thanks to Michael Abbott for the patch. --- numpy/core/src/arrayobject.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'numpy/core/src/arrayobject.c') diff --git a/numpy/core/src/arrayobject.c b/numpy/core/src/arrayobject.c index 9ea986297..d1074a887 100644 --- a/numpy/core/src/arrayobject.c +++ b/numpy/core/src/arrayobject.c @@ -4717,24 +4717,24 @@ _strings_richcompare(PyArrayObject *self, PyArrayObject *other, int cmp_op, PyObject *new; if (self->descr->type_num == PyArray_STRING && \ other->descr->type_num == PyArray_UNICODE) { - Py_INCREF(other); Py_INCREF(other->descr); new = PyArray_FromAny((PyObject *)self, other->descr, 0, 0, 0, NULL); if (new == NULL) { return NULL; } + Py_INCREF(other); self = (PyArrayObject *)new; } else if (self->descr->type_num == PyArray_UNICODE && \ other->descr->type_num == PyArray_STRING) { - Py_INCREF(self); Py_INCREF(self->descr); new = PyArray_FromAny((PyObject *)other, self->descr, 0, 0, 0, NULL); if (new == NULL) { return NULL; } + Py_INCREF(self); other = (PyArrayObject *)new; } else { -- cgit v1.2.1