[Numpy-svn] r5436 - trunk/numpy/core/src

numpy-svn@scip... numpy-svn@scip...
Wed Jul 16 15:23:31 CDT 2008


Author: charris
Date: 2008-07-16 15:23:29 -0500 (Wed, 16 Jul 2008)
New Revision: 5436

Modified:
   trunk/numpy/core/src/arrayobject.c
Log:
Fix ticket #850. Thanks to Michael Abbott for the patch.


Modified: trunk/numpy/core/src/arrayobject.c
===================================================================
--- trunk/numpy/core/src/arrayobject.c	2008-07-16 19:47:28 UTC (rev 5435)
+++ trunk/numpy/core/src/arrayobject.c	2008-07-16 20:23:29 UTC (rev 5436)
@@ -4717,24 +4717,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