Commit 50363262 authored by Ezio Melotti's avatar Ezio Melotti

Merged revisions 78319 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/trunk

........
  r78319 | ezio.melotti | 2010-02-22 18:30:58 +0200 (Mon, 22 Feb 2010) | 1 line

  #7482: clarify error message in case of division by zero of float and complex numbers.
........
parent 19e4acfa
...@@ -504,7 +504,7 @@ complex_div(PyObject *v, PyObject *w) ...@@ -504,7 +504,7 @@ complex_div(PyObject *v, PyObject *w)
quot = c_quot(a, b); quot = c_quot(a, b);
PyFPE_END_PROTECT(quot) PyFPE_END_PROTECT(quot)
if (errno == EDOM) { if (errno == EDOM) {
PyErr_SetString(PyExc_ZeroDivisionError, "complex division"); PyErr_SetString(PyExc_ZeroDivisionError, "complex division by zero");
return NULL; return NULL;
} }
return PyComplex_FromCComplex(quot); return PyComplex_FromCComplex(quot);
......
...@@ -570,7 +570,7 @@ float_div(PyObject *v, PyObject *w) ...@@ -570,7 +570,7 @@ float_div(PyObject *v, PyObject *w)
#ifdef Py_NAN #ifdef Py_NAN
if (b == 0.0) { if (b == 0.0) {
PyErr_SetString(PyExc_ZeroDivisionError, PyErr_SetString(PyExc_ZeroDivisionError,
"float division"); "float division by zero");
return NULL; return NULL;
} }
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment