mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
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:
parent
bd6f4fba1b
commit
661ea26b3d
16 changed files with 186 additions and 144 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue