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

numpy-svn at scipy.org numpy-svn at scipy.org
Fri Oct 6 20:42:41 CDT 2006


Author: oliphant
Date: 2006-10-06 20:42:39 -0500 (Fri, 06 Oct 2006)
New Revision: 3275

Modified:
   trunk/numpy/core/src/arraytypes.inc.src
Log:
Fix last OBJECT function to handle NULLS.

Modified: trunk/numpy/core/src/arraytypes.inc.src
===================================================================
--- trunk/numpy/core/src/arraytypes.inc.src	2006-10-07 01:36:39 UTC (rev 3274)
+++ trunk/numpy/core/src/arraytypes.inc.src	2006-10-07 01:42:39 UTC (rev 3275)
@@ -1821,11 +1821,18 @@
 {
         intp i;
         PyObject *tmp1, *tmp2, *tmp=NULL;
+        PyObject *in1, *in2;
         PyObject **tmp3;
         for(i=0;i<n;i++,ip1+=is1,ip2+=is2) {
-                tmp1 = PyNumber_Multiply(*((PyObject **)ip1),
-                                         *((PyObject **)ip2));
-                if (!tmp1) { Py_XDECREF(tmp); return;}
+                if ((*((PyObject **)ip1) == NULL) || (*((PyObject **)ip2) == NULL)) {
+                        tmp1 = Py_False;
+                        Py_INCREF(Py_False);
+                }
+                else {
+                        tmp1 = PyNumber_Multiply(*((PyObject **)ip1),
+                                                 *((PyObject **)ip2));
+                        if (!tmp1) { Py_XDECREF(tmp); return;}
+                }
                 if (i == 0) {
                         tmp = tmp1;
                 } else {



More information about the Numpy-svn mailing list