diff options
author | Travis Oliphant <oliphant@enthought.com> | 2006-10-07 01:42:39 +0000 |
---|---|---|
committer | Travis Oliphant <oliphant@enthought.com> | 2006-10-07 01:42:39 +0000 |
commit | 1e339d7f58653beba15714fdeead052ed9d73611 (patch) | |
tree | 628c3654cd0d8e9ad6bd543632fc89338b2febbb | |
parent | ce24459130f1d909d6fa051acf1da2aab19f32e0 (diff) | |
download | numpy-1e339d7f58653beba15714fdeead052ed9d73611.tar.gz |
Fix last OBJECT function to handle NULLS.
-rw-r--r-- | numpy/core/src/arraytypes.inc.src | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/numpy/core/src/arraytypes.inc.src b/numpy/core/src/arraytypes.inc.src index 496a0306e..e4335ec27 100644 --- a/numpy/core/src/arraytypes.inc.src +++ b/numpy/core/src/arraytypes.inc.src @@ -1821,11 +1821,18 @@ OBJECT_dot(char *ip1, intp is1, char *ip2, intp is2, char *op, intp n, { 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 { |