diff options
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/core/src/multiarray/compiled_base.c | 4 | ||||
-rw-r--r-- | numpy/lib/tests/test_function_base.py | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/numpy/core/src/multiarray/compiled_base.c b/numpy/core/src/multiarray/compiled_base.c index f18ce155e..b0225985c 100644 --- a/numpy/core/src/multiarray/compiled_base.c +++ b/numpy/core/src/multiarray/compiled_base.c @@ -135,7 +135,7 @@ arr_bincount(PyObject *NPY_UNUSED(self), PyObject *args, PyObject *kwds) if (minlength < 0) { PyErr_SetString(PyExc_ValueError, - "minlength must be non-negative"); + "'minlength' must not be negative"); goto fail; } @@ -153,7 +153,7 @@ arr_bincount(PyObject *NPY_UNUSED(self), PyObject *args, PyObject *kwds) minmax(numbers, len, &mn, &mx); if (mn < 0) { PyErr_SetString(PyExc_ValueError, - "The first argument of bincount must be non-negative"); + "'list' argument must have no negative elements"); goto fail; } ans_size = mx + 1; diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py index 10440d97c..39edc18b4 100644 --- a/numpy/lib/tests/test_function_base.py +++ b/numpy/lib/tests/test_function_base.py @@ -2623,7 +2623,7 @@ class TestBincount(object): "'str' object cannot be interpreted", lambda: np.bincount(x, minlength="foobar")) assert_raises_regex(ValueError, - "must be non-negative", + "must not be negative", lambda: np.bincount(x, minlength=-1)) x = np.arange(5) @@ -2631,7 +2631,7 @@ class TestBincount(object): "'str' object cannot be interpreted", lambda: np.bincount(x, minlength="foobar")) assert_raises_regex(ValueError, - "minlength must be non-negative", + "must not be negative", lambda: np.bincount(x, minlength=-1)) @dec.skipif(not HAS_REFCOUNT, "python has no sys.getrefcount") |