Commit 826b9ddb authored by Martin v. Löwis's avatar Martin v. Löwis

Fix getclassname. Fixes test_descrtut.

parent 5b222135
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment