[Python-checkins] python/dist/src/Objects stringobject.c,2.147.6.4,2.147.6.5
doerwalter@sourceforge.net
doerwalter@sourceforge.net
Mon, 13 May 2002 02:11:47 -0700
Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv18221/Objects
Modified Files:
Tag: release22-maint
stringobject.c
Log Message:
Backport checkin:
Add #ifdef PY_USING_UNICODE sections, so that
stringobject.c compiles again with --disable-unicode.
Fixes SF bug http://www.python.org/sf/554912
Index: stringobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/stringobject.c,v
retrieving revision 2.147.6.4
retrieving revision 2.147.6.5
diff -C2 -d -r2.147.6.4 -r2.147.6.5
*** stringobject.c 30 Apr 2002 03:41:53 -0000 2.147.6.4
--- stringobject.c 13 May 2002 09:11:44 -0000 2.147.6.5
***************
*** 1490,1493 ****
--- 1490,1494 ----
if (PyString_Check(sep))
return do_xstrip(self, striptype, sep);
+ #ifdef Py_USING_UNICODE
else if (PyUnicode_Check(sep)) {
PyObject *uniself = PyUnicode_FromObject((PyObject *)self);
***************
*** 1500,1506 ****
--- 1501,1512 ----
return res;
}
+ #endif
else {
PyErr_Format(PyExc_TypeError,
+ #ifdef Py_USING_UNICODE
"%s arg must be None, str or unicode",
+ #else
+ "%s arg must be None or str",
+ #endif
STRIPNAME(striptype));
return NULL;