Fix getclassname. Fixes test_descrtut.
This commit is contained in:
parent
5b222135f8
commit
826b9ddbe3
|
@ -313,8 +313,8 @@ getclassname(PyObject *klass, char *buf, int bufsize)
|
|||
PyErr_Clear();
|
||||
return;
|
||||
}
|
||||
if (PyString_Check(name)) {
|
||||
strncpy(buf, PyString_AS_STRING(name), bufsize);
|
||||
if (PyUnicode_Check(name)) {
|
||||
strncpy(buf, PyUnicode_AsString(name), bufsize);
|
||||
buf[bufsize-1] = '\0';
|
||||
}
|
||||
Py_DECREF(name);
|
||||
|
|
Loading…
Reference in New Issue