Issue #18184: PyUnicode_FromFormat() and PyUnicode_FromFormatV() now raise

OverflowError when an argument of %c format is out of range.
This commit is contained in:
Serhiy Storchaka 2013-06-23 20:21:16 +03:00
commit c89533f72f
3 changed files with 6 additions and 1 deletions

View file

@ -2496,7 +2496,7 @@ unicode_fromformat_arg(_PyUnicodeWriter *writer,
{
int ordinal = va_arg(*vargs, int);
if (ordinal < 0 || ordinal > MAX_UNICODE) {
PyErr_SetString(PyExc_ValueError,
PyErr_SetString(PyExc_OverflowError,
"character argument not in range(0x110000)");
return NULL;
}