summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/src/multiarray/arraytypes.c.src2
-rw-r--r--numpy/core/tests/test_nep50_promotions.py3
2 files changed, 3 insertions, 2 deletions
diff --git a/numpy/core/src/multiarray/arraytypes.c.src b/numpy/core/src/multiarray/arraytypes.c.src
index 69422d5e2..b7c339aa2 100644
--- a/numpy/core/src/multiarray/arraytypes.c.src
+++ b/numpy/core/src/multiarray/arraytypes.c.src
@@ -305,7 +305,7 @@ static int
else {
/* Live in the future, outright error: */
PyErr_Format(PyExc_OverflowError,
- "Python int %R too large to convert to %S", obj, descr);
+ "Python integer %R out of bounds for %S", obj, descr);
Py_DECREF(descr);
return -1;
}
diff --git a/numpy/core/tests/test_nep50_promotions.py b/numpy/core/tests/test_nep50_promotions.py
index 4bc034920..be6cf92a5 100644
--- a/numpy/core/tests/test_nep50_promotions.py
+++ b/numpy/core/tests/test_nep50_promotions.py
@@ -165,7 +165,8 @@ def test_nep50_integer_conversion_errors():
np.uint8(1) + 300
# Error message depends on platform (maybe unsigned int or unsigned long)
- with pytest.raises(OverflowError, match=".*unsigned"):
+ with pytest.raises(OverflowError,
+ match="Python integer -1 out of bounds for uint8"):
np.uint8(1) + -1