From: Walter Dörwald Date: Mon, 13 May 2002 09:11:44 +0000 (+0000) Subject: Backport checkin: X-Git-Tag: v2.2.2b1~375 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=332a458dd1527be21bc3c93e4eff692070439f24;p=thirdparty%2FPython%2Fcpython.git 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 --- diff --git a/Objects/stringobject.c b/Objects/stringobject.c index 00f5d986a262..dd74569fda47 100644 --- a/Objects/stringobject.c +++ b/Objects/stringobject.c @@ -1489,6 +1489,7 @@ do_argstrip(PyStringObject *self, int striptype, PyObject *args) if (sep != NULL && sep != Py_None) { 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); PyObject *res; @@ -1499,9 +1500,14 @@ do_argstrip(PyStringObject *self, int striptype, PyObject *args) Py_DECREF(uniself); 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; }