[Python-checkins] CVS: python/dist/src/Python bltinmodule.c,2.217,2.218

M.-A. Lemburg lemburg@users.sourceforge.net
Thu, 26 Jul 2001 09:29:28 -0700


Update of /cvsroot/python/python/dist/src/Python
In directory usw-pr-cvs1:/tmp/cvs-serv23389/Python

Modified Files:
	bltinmodule.c 
Log Message:
Undoing the UCS-4 patch addition which caused unichr() to return
surrogates for Unicode code points outside range(0x10000) on narrow
Python builds.



Index: bltinmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/bltinmodule.c,v
retrieving revision 2.217
retrieving revision 2.218
diff -C2 -d -r2.217 -r2.218
*** bltinmodule.c	2001/07/16 02:29:45	2.217
--- bltinmodule.c	2001/07/26 16:29:25	2.218
***************
*** 314,322 ****
  		return NULL;
  
  	if (x < 0 || x > 0x10ffff) {
  		PyErr_SetString(PyExc_ValueError,
! 				"unichr() arg not in range(0x110000)");
  		return NULL;
  	}
  
  	if (x <= 0xffff) {
--- 314,332 ----
  		return NULL;
  
+ #ifdef Py_UNICODE_WIDE
  	if (x < 0 || x > 0x10ffff) {
  		PyErr_SetString(PyExc_ValueError,
! 				"unichr() arg not in range(0x110000) "
! 				"(wide Python build)");
! 		return NULL;
! 	}
! #else
! 	if (x < 0 || x > 0xffff) {
! 		PyErr_SetString(PyExc_ValueError,
! 				"unichr() arg not in range(0x10000) "
! 				"(narrow Python build)");
  		return NULL;
  	}
+ #endif
  
  	if (x <= 0xffff) {