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

numpy-svn@scip... numpy-svn@scip...
Mon Mar 26 15:47:13 CDT 2007


Author: oliphant
Date: 2007-03-26 15:47:11 -0500 (Mon, 26 Mar 2007)
New Revision: 3601

Modified:
   trunk/numpy/core/src/multiarraymodule.c
Log:
Fix some errors with recent scalar coercion changes.

Modified: trunk/numpy/core/src/multiarraymodule.c
===================================================================
--- trunk/numpy/core/src/multiarraymodule.c	2007-03-26 20:40:01 UTC (rev 3600)
+++ trunk/numpy/core/src/multiarraymodule.c	2007-03-26 20:47:11 UTC (rev 3601)
@@ -1983,7 +1983,7 @@
 			mps[i] = NULL;
 		}
 	}
-        else if (intypekind != scalarkind) { \
+        else if ((stype != NULL) && (intypekind != scalarkind)) {       \
                 /* we need to upconvert to type that
                    handles both intype and stype
                    and don't forcecast the scalars.
@@ -1994,6 +1994,7 @@
                                              scalarkind)) {
                         Py_XDECREF(intype);
                         intype = stype;
+                        Py_INCREF(stype);
                 }
                 for (i=0; i<n; i++) {
                         Py_XDECREF(mps[i]);



More information about the Numpy-svn mailing list