summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWalter Dörwald <walter@livinglogic.de>2002-05-13 09:00:41 (GMT)
committerWalter Dörwald <walter@livinglogic.de>2002-05-13 09:00:41 (GMT)
commit775c11f07ab766325b12f125ec52c495c0478b0b (patch)
treebd4b87cf4a5678f29af0746a9c92a1e4ca090dfd
parent87f59eeb0a544ca61ab017d86ed15dbd6716e5b1 (diff)
downloadcpython-775c11f07ab766325b12f125ec52c495c0478b0b.zip
cpython-775c11f07ab766325b12f125ec52c495c0478b0b.tar.gz
cpython-775c11f07ab766325b12f125ec52c495c0478b0b.tar.bz2
Add #ifdef PY_USING_UNICODE sections, so that
stringobject.c compiles again with --disable-unicode. Fixes SF bug http://www.python.org/sf/554912
-rw-r--r--Objects/stringobject.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Objects/stringobject.c b/Objects/stringobject.c
index 5bad04e..6c18add 100644
--- a/Objects/stringobject.c
+++ b/Objects/stringobject.c
@@ -1457,6 +1457,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;
@@ -1467,9 +1468,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;
}