mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00: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
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue