[Python-checkins] python/dist/src/Objects unicodeobject.c,2.184,2.185

doerwalter@users.sourceforge.net doerwalter@users.sourceforge.net
Wed, 02 Apr 2003 08:37:26 -0800


Update of /cvsroot/python/python/dist/src/Objects
In directory sc8-pr-cvs1:/tmp/cvs-serv13323/Objects

Modified Files:
	unicodeobject.c 
Log Message:
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.


Index: unicodeobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/unicodeobject.c,v
retrieving revision 2.184
retrieving revision 2.185
diff -C2 -d -r2.184 -r2.185
*** unicodeobject.c	9 Mar 2003 07:30:43 -0000	2.184
--- unicodeobject.c	2 Apr 2003 16:37:23 -0000	2.185
***************
*** 6158,6162 ****
  #ifdef Py_UNICODE_WIDE
  	if (x < 0 || x > 0x10ffff) {
! 	    PyErr_SetString(PyExc_ValueError,
  			    "%c arg not in range(0x110000) "
  			    "(wide Python build)");
--- 6158,6162 ----
  #ifdef Py_UNICODE_WIDE
  	if (x < 0 || x > 0x10ffff) {
! 	    PyErr_SetString(PyExc_OverflowError,
  			    "%c arg not in range(0x110000) "
  			    "(wide Python build)");
***************
*** 6165,6169 ****
  #else
  	if (x < 0 || x > 0xffff) {
! 	    PyErr_SetString(PyExc_ValueError,
  			    "%c arg not in range(0x10000) "
  			    "(narrow Python build)");
--- 6165,6169 ----
  #else
  	if (x < 0 || x > 0xffff) {
! 	    PyErr_SetString(PyExc_OverflowError,
  			    "%c arg not in range(0x10000) "
  			    "(narrow Python build)");