Skip to content

Commit 928115a

Browse files
committed
CFunctions' doc strings should be Unicode.
1 parent 13e05de commit 928115a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Objects/methodobject.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ meth_get__doc__(PyCFunctionObject *m, void *closure)
135135
const char *doc = m->m_ml->ml_doc;
136136

137137
if (doc != NULL)
138-
return PyString_FromString(doc);
138+
return PyUnicode_FromString(doc);
139139
Py_INCREF(Py_None);
140140
return Py_None;
141141
}
@@ -284,7 +284,7 @@ Py_FindMethodInChain(PyMethodChain *chain, PyObject *self, const char *name)
284284
if (strcmp(name, "__doc__") == 0) {
285285
const char *doc = self->ob_type->tp_doc;
286286
if (doc != NULL)
287-
return PyString_FromString(doc);
287+
return PyUnicode_FromString(doc);
288288
}
289289
}
290290
while (chain != NULL) {

0 commit comments

Comments
 (0)