diff options
-rw-r--r-- | numpy/core/numeric.py | 6 | ||||
-rw-r--r-- | numpy/core/src/ufuncobject.c | 3 |
2 files changed, 6 insertions, 3 deletions
diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py index 71c74c123..a74fb158b 100644 --- a/numpy/core/numeric.py +++ b/numpy/core/numeric.py @@ -537,9 +537,11 @@ def setbufsize(size): """Set the size of the buffer used in ufuncs. """ if size > 10e6: - raise ValueError, "Buffer size too big... %s" % size + raise ValueError, "Buffer size, %s, is too big." % size if size < 5: - raise ValueError, "Buffer size too small... %s" %size + raise ValueError, "Buffer size, %s, is too small." %size + if size % 16 != 0: + raise ValueError, "Buffer size, %s, is not a multiple of 16." %size pyvals = umath.geterrobj() old = getbufsize() diff --git a/numpy/core/src/ufuncobject.c b/numpy/core/src/ufuncobject.c index d5e96b0ef..74a24e78b 100644 --- a/numpy/core/src/ufuncobject.c +++ b/numpy/core/src/ufuncobject.c @@ -2490,7 +2490,8 @@ PyUFunc_GenericReduction(PyUFuncObject *self, PyObject *args, } /* Check to see that type (and otype) is not FLEXIBLE */ - if (PyArray_ISFLEXIBLE(mp) || (otype && PyTypeNum_ISFLEXIBLE(otype->type_num))) { + if (PyArray_ISFLEXIBLE(mp) || + (otype && PyTypeNum_ISFLEXIBLE(otype->type_num))) { PyErr_Format(PyExc_TypeError, "cannot perform %s with flexible type", _reduce_type[operation]); |