diff options
author | David Cournapeau <cournape@gmail.com> | 2009-03-09 15:26:28 +0000 |
---|---|---|
committer | David Cournapeau <cournape@gmail.com> | 2009-03-09 15:26:28 +0000 |
commit | dd8299b40e9128b18abd7df1adb462f53bb2493a (patch) | |
tree | f850f5b82d83b6d67e22e6349196f66d67196d3e | |
parent | 0588cb85b3c5037365432aab213d82b79a4bd25b (diff) | |
download | numpy-dd8299b40e9128b18abd7df1adb462f53bb2493a.tar.gz |
BUG: when a new type is required, and the fast clip function is updated, make sure the function pointer is not NULL - if it is, fall back to slow array.
-rw-r--r-- | numpy/core/src/multiarraymodule.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/numpy/core/src/multiarraymodule.c b/numpy/core/src/multiarraymodule.c index 6e3a9d98e..9c6454d3f 100644 --- a/numpy/core/src/multiarraymodule.c +++ b/numpy/core/src/multiarraymodule.c @@ -1416,6 +1416,9 @@ PyArray_Clip(PyArrayObject *self, PyObject *min, PyObject *max, PyArrayObject *o PyArray_ScalarKind(self->descr->type_num, NULL)) { indescr = _array_small_type(newdescr, self->descr); func = indescr->f->fastclip; + if (func == NULL) { + return _slow_array_clip(self, min, max, out); + } } else { indescr = self->descr; |