Ka-Ping Yee <ping@lfw.org>:

Changes to error messages to increase consistency & clarity.

This (mostly) closes SourceForge patch #101839.
This commit is contained in:
Fred Drake 2000-10-24 19:57:45 +00:00
parent bd6f4fba1b
commit 661ea26b3d
16 changed files with 186 additions and 144 deletions

View file

@ -466,7 +466,7 @@ float_pow(PyFloatObject *v, PyObject *w, PyFloatObject *z)
if (iv == 0.0) {
if (iw < 0.0) {
PyErr_SetString(PyExc_ZeroDivisionError,
"0.0 to a negative power");
"0.0 cannot be raised to a negative power");
return NULL;
}
return PyFloat_FromDouble(0.0);
@ -486,7 +486,7 @@ float_pow(PyFloatObject *v, PyObject *w, PyFloatObject *z)
/* Sort out special cases here instead of relying on pow() */
if (iv < 0.0) {
PyErr_SetString(PyExc_ValueError,
"negative number to a float power");
"negative number cannot be raised to a fractional power");
return NULL;
}
errno = 0;