diff options
author | Walter Dörwald <walter@livinglogic.de> | 2003-04-02 16:37:24 (GMT) |
---|---|---|
committer | Walter Dörwald <walter@livinglogic.de> | 2003-04-02 16:37:24 (GMT) |
commit | 44f527fea4c73038322c7c6647e20e47c2ccdd88 (patch) | |
tree | e920c6ed07d27c81c080a3fd8297dc6fd66418c2 /Objects | |
parent | 7ba256f039ff917bfa3fe6fc0f9a6abd8e922ef3 (diff) | |
download | cpython-44f527fea4c73038322c7c6647e20e47c2ccdd88.zip cpython-44f527fea4c73038322c7c6647e20e47c2ccdd88.tar.gz cpython-44f527fea4c73038322c7c6647e20e47c2ccdd88.tar.bz2 |
Change formatchar(), so that u"%c" % 0xffffffff now raises
an OverflowError instead of a TypeError to be consistent
with "%c" % 256. See SF patch #710127.
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/unicodeobject.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index dcfde34..b167a1d 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -6157,14 +6157,14 @@ formatchar(Py_UNICODE *buf, goto onError; #ifdef Py_UNICODE_WIDE if (x < 0 || x > 0x10ffff) { - PyErr_SetString(PyExc_ValueError, + PyErr_SetString(PyExc_OverflowError, "%c arg not in range(0x110000) " "(wide Python build)"); return -1; } #else if (x < 0 || x > 0xffff) { - PyErr_SetString(PyExc_ValueError, + PyErr_SetString(PyExc_OverflowError, "%c arg not in range(0x10000) " "(narrow Python build)"); return -1; |