]> granicus.if.org Git - python/commitdiff
Add #ifdef PY_USING_UNICODE sections, so that
authorWalter Dörwald <walter@livinglogic.de>
Mon, 13 May 2002 09:00:41 +0000 (09:00 +0000)
committerWalter Dörwald <walter@livinglogic.de>
Mon, 13 May 2002 09:00:41 +0000 (09:00 +0000)
stringobject.c compiles again with --disable-unicode.

Fixes SF bug http://www.python.org/sf/554912

Objects/stringobject.c

index 5bad04e55284c95ea573949be6d9e3a501c91e44..6c18addcafc20bbce21013bbbfdef2a4ff556792 100644 (file)
@@ -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;
                }