diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2013-06-23 17:21:16 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2013-06-23 17:21:16 (GMT) |
commit | c89533f72fbf15779d33c4533c801ed4c3d0ea18 (patch) | |
tree | 01f4fe4d0c1ca2ff5eac6f5158b0a58a2d309b6f /Objects | |
parent | fcce2024ea97c76e25adf9ff45f72a9f0d431ac3 (diff) | |
parent | 8eeae2126ca7dd91ae6f10443eda1af5338bccf7 (diff) | |
download | cpython-c89533f72fbf15779d33c4533c801ed4c3d0ea18.zip cpython-c89533f72fbf15779d33c4533c801ed4c3d0ea18.tar.gz cpython-c89533f72fbf15779d33c4533c801ed4c3d0ea18.tar.bz2 |
Issue #18184: PyUnicode_FromFormat() and PyUnicode_FromFormatV() now raise
OverflowError when an argument of %c format is out of range.
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/unicodeobject.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index c40e9ec..5659c71 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -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; } |