Mercurial > cpython-lru_cache-weakref
diff Objects/stringobject.c @ 23430:1be6e79b1d46 legacy-trunk
Add #ifdef PY_USING_UNICODE sections, so that
stringobject.c compiles again with --disable-unicode.
Fixes SF bug http://www.python.org/sf/554912
| author | Walter Dörwald <walter@livinglogic.de> |
|---|---|
| date | Mon, 13 May 2002 09:00:41 +0000 |
| parents | 6fa76b4e59fe |
| children | 76f376bea5e5 |
line wrap: on
line diff
--- a/Objects/stringobject.c Mon May 13 04:17:32 2002 +0000 +++ b/Objects/stringobject.c Mon May 13 09:00:41 2002 +0000 @@ -1457,6 +1457,7 @@ 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; @@ -1467,9 +1468,14 @@ 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; }
