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

@ -2460,7 +2460,7 @@ formatfloat(char *buf, size_t buflen, int flags,
always given), therefore increase by one to 10+prec. */
if (buflen <= (size_t)10 + (size_t)prec) {
PyErr_SetString(PyExc_OverflowError,
"formatted float is too long (precision too long?)");
"formatted float is too long (precision too large?)");
return -1;
}
sprintf(buf, fmt, x);
@ -2626,7 +2626,7 @@ formatint(char *buf, size_t buflen, int flags,
worst case buf = '0x' + [0-9]*prec, where prec >= 11 */
if (buflen <= 13 || buflen <= (size_t)2 + (size_t)prec) {
PyErr_SetString(PyExc_OverflowError,
"formatted integer is too long (precision too long?)");
"formatted integer is too long (precision too large?)");
return -1;
}
sprintf(buf, fmt, x);