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();
|
PyErr_Clear();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (PyString_Check(name)) {
|
if (PyUnicode_Check(name)) {
|
||||||
strncpy(buf, PyString_AS_STRING(name), bufsize);
|
strncpy(buf, PyUnicode_AsString(name), bufsize);
|
||||||
buf[bufsize-1] = '\0';
|
buf[bufsize-1] = '\0';
|
||||||
}
|
}
|
||||||
Py_DECREF(name);
|
Py_DECREF(name);
|
||||||
|
|
Loading…
Reference in New Issue