summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2010-02-22 16:30:58 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2010-02-22 16:30:58 (GMT)
commitbce3e17bd2897d998b08b34420877fbc09a9ca75 (patch)
treed2bfa6b4db7b9f1610ff9dc7294a4aedd84a789c /Objects
parent38c123651c4eb04ea093162ecdcbd217eb125341 (diff)
downloadcpython-bce3e17bd2897d998b08b34420877fbc09a9ca75.zip
cpython-bce3e17bd2897d998b08b34420877fbc09a9ca75.tar.gz
cpython-bce3e17bd2897d998b08b34420877fbc09a9ca75.tar.bz2
#7482: clarify error message in case of division by zero of float and complex numbers.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/complexobject.c4
-rw-r--r--Objects/floatobject.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/Objects/complexobject.c b/Objects/complexobject.c
index da2075a..42e447d 100644
--- a/Objects/complexobject.c
+++ b/Objects/complexobject.c
@@ -563,7 +563,7 @@ complex_div(PyObject *v, PyObject *w)
quot = c_quot(a, b);
PyFPE_END_PROTECT(quot)
if (errno == EDOM) {
- PyErr_SetString(PyExc_ZeroDivisionError, "complex division");
+ PyErr_SetString(PyExc_ZeroDivisionError, "complex division by zero");
return NULL;
}
return PyComplex_FromCComplex(quot);
@@ -586,7 +586,7 @@ complex_classic_div(PyObject *v, PyObject *w)
quot = c_quot(a, b);
PyFPE_END_PROTECT(quot)
if (errno == EDOM) {
- PyErr_SetString(PyExc_ZeroDivisionError, "complex division");
+ PyErr_SetString(PyExc_ZeroDivisionError, "complex division by zero");
return NULL;
}
return PyComplex_FromCComplex(quot);
diff --git a/Objects/floatobject.c b/Objects/floatobject.c
index d93d9f9..3f76e91 100644
--- a/Objects/floatobject.c
+++ b/Objects/floatobject.c
@@ -668,7 +668,7 @@ float_div(PyObject *v, PyObject *w)
#ifdef Py_NAN
if (b == 0.0) {
PyErr_SetString(PyExc_ZeroDivisionError,
- "float division");
+ "float division by zero");
return NULL;
}
#endif
@@ -690,7 +690,7 @@ float_classic_div(PyObject *v, PyObject *w)
#ifdef Py_NAN
if (b == 0.0) {
PyErr_SetString(PyExc_ZeroDivisionError,
- "float division");
+ "float division by zero");
return NULL;
}
#endif