summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorDavid Cournapeau <cournape@gmail.com>2009-03-09 15:26:28 +0000
committerDavid Cournapeau <cournape@gmail.com>2009-03-09 15:26:28 +0000
commitdd8299b40e9128b18abd7df1adb462f53bb2493a (patch)
treef850f5b82d83b6d67e22e6349196f66d67196d3e /numpy
parent0588cb85b3c5037365432aab213d82b79a4bd25b (diff)
downloadnumpy-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.
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/src/multiarraymodule.c3
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;