mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-119057: Use better error messages for zero division (#119066)
This commit is contained in:
parent
153b118b78
commit
1d4c2e4a87
11 changed files with 32 additions and 20 deletions
|
@ -3121,8 +3121,7 @@ long_divrem(PyLongObject *a, PyLongObject *b,
|
|||
PyLongObject *z;
|
||||
|
||||
if (size_b == 0) {
|
||||
PyErr_SetString(PyExc_ZeroDivisionError,
|
||||
"integer division or modulo by zero");
|
||||
PyErr_SetString(PyExc_ZeroDivisionError, "division by zero");
|
||||
return -1;
|
||||
}
|
||||
if (size_a < size_b ||
|
||||
|
@ -3185,7 +3184,7 @@ long_rem(PyLongObject *a, PyLongObject *b, PyLongObject **prem)
|
|||
|
||||
if (size_b == 0) {
|
||||
PyErr_SetString(PyExc_ZeroDivisionError,
|
||||
"integer modulo by zero");
|
||||
"division by zero");
|
||||
return -1;
|
||||
}
|
||||
if (size_a < size_b ||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue