mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
CFunctions' doc strings should be Unicode.
This commit is contained in:
parent
13e05de9ef
commit
928115af72
1 changed files with 2 additions and 2 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue