diff options
author | Nikita Sobolev <mail@sobolevn.me> | 2024-06-03 16:03:56 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-03 16:03:56 (GMT) |
commit | 1d4c2e4a877a48cdc8bcc9808d799b91c82b3757 (patch) | |
tree | b1557ecdd66700385d26ae2e398dc34f54e2f964 /Objects/complexobject.c | |
parent | 153b118b78588209850cc2a4cbc977f193a3ab6e (diff) | |
download | cpython-1d4c2e4a877a48cdc8bcc9808d799b91c82b3757.zip cpython-1d4c2e4a877a48cdc8bcc9808d799b91c82b3757.tar.gz cpython-1d4c2e4a877a48cdc8bcc9808d799b91c82b3757.tar.bz2 |
gh-119057: Use better error messages for zero division (#119066)
Diffstat (limited to 'Objects/complexobject.c')
-rw-r--r-- | Objects/complexobject.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/complexobject.c b/Objects/complexobject.c index 59c84f1..a8be266 100644 --- a/Objects/complexobject.c +++ b/Objects/complexobject.c @@ -523,7 +523,7 @@ complex_div(PyObject *v, PyObject *w) errno = 0; quot = _Py_c_quot(a, b); if (errno == EDOM) { - PyErr_SetString(PyExc_ZeroDivisionError, "complex division by zero"); + PyErr_SetString(PyExc_ZeroDivisionError, "division by zero"); return NULL; } return PyComplex_FromCComplex(quot); @@ -554,7 +554,7 @@ complex_pow(PyObject *v, PyObject *w, PyObject *z) _Py_ADJUST_ERANGE2(p.real, p.imag); if (errno == EDOM) { PyErr_SetString(PyExc_ZeroDivisionError, - "0.0 to a negative or complex power"); + "zero to a negative or complex power"); return NULL; } else if (errno == ERANGE) { |