[Numpy-svn] r5437 - branches/1.1.x/numpy/core/src

numpy-svn@scip... numpy-svn@scip...
Wed Jul 16 15:24:34 CDT 2008


Author: charris
Date: 2008-07-16 15:24:32 -0500 (Wed, 16 Jul 2008)
New Revision: 5437

Modified:
   branches/1.1.x/numpy/core/src/arrayobject.c
Log:
Backport fix for ticket #850.


Modified: branches/1.1.x/numpy/core/src/arrayobject.c
===================================================================
--- branches/1.1.x/numpy/core/src/arrayobject.c	2008-07-16 20:23:29 UTC (rev 5436)
+++ branches/1.1.x/numpy/core/src/arrayobject.c	2008-07-16 20:24:32 UTC (rev 5437)
@@ -4714,24 +4714,24 @@
         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 {



More information about the Numpy-svn mailing list