Fix getclassname. Fixes test_descrtut.

This commit is contained in:
Martin v. Löwis 2007-06-10 21:09:40 +00:00
parent 5b222135f8
commit 826b9ddbe3
1 changed files with 2 additions and 2 deletions

View File

@ -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);