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