]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
CFunctions' doc strings should be Unicode.
authorGuido van Rossum <guido@python.org>
Thu, 23 Aug 2007 23:35:15 +0000 (23:35 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 23 Aug 2007 23:35:15 +0000 (23:35 +0000)
Objects/methodobject.c

index 5f5d595cadb48d33201f28a51e72a51c6ed701a5..d7dc2807f40b8d469cc381b51d4eba96d92b7f33 100644 (file)
@@ -135,7 +135,7 @@ meth_get__doc__(PyCFunctionObject *m, void *closure)
        const char *doc = m->m_ml->ml_doc;
 
        if (doc != NULL)
-               return PyString_FromString(doc);
+               return PyUnicode_FromString(doc);
        Py_INCREF(Py_None);
        return Py_None;
 }
@@ -284,7 +284,7 @@ Py_FindMethodInChain(PyMethodChain *chain, PyObject *self, const char *name)
                if (strcmp(name, "__doc__") == 0) {
                        const char *doc = self->ob_type->tp_doc;
                        if (doc != NULL)
-                               return PyString_FromString(doc);
+                               return PyUnicode_FromString(doc);
                }
        }
        while (chain != NULL) {