From 24effb6b7a075e23d85ea0b60ed8a607fe218c14 Mon Sep 17 00:00:00 2001 From: Lars Buitinck Date: Sun, 30 Nov 2014 22:20:24 +0100 Subject: ENH ensure np.packbits works on np.bool dtype --- numpy/lib/src/_compiled_base.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'numpy/lib/src') diff --git a/numpy/lib/src/_compiled_base.c b/numpy/lib/src/_compiled_base.c index 0cf034fca..99aec38f0 100644 --- a/numpy/lib/src/_compiled_base.c +++ b/numpy/lib/src/_compiled_base.c @@ -1376,9 +1376,9 @@ pack_bits(PyObject *input, int axis) if (inp == NULL) { return NULL; } - if (!PyArray_ISINTEGER(inp)) { + if (!PyArray_ISBOOL(inp) && !PyArray_ISINTEGER(inp)) { PyErr_SetString(PyExc_TypeError, - "Expected an input array of integer data type"); + "Expected an input array of integer or boolean data type"); goto fail; } -- cgit v1.2.1