summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2007-06-10 21:13:34 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2007-06-10 21:13:34 (GMT)
commit9b9905b2f435b28ed0e971a1187f90a3e273f642 (patch)
tree9909945a93d30118fdcf4a2c4b82be2b063bfbae /Objects
parent826b9ddbe367443803c9f34453c3414abb635502 (diff)
downloadcpython-9b9905b2f435b28ed0e971a1187f90a3e273f642.zip
cpython-9b9905b2f435b28ed0e971a1187f90a3e273f642.tar.gz
cpython-9b9905b2f435b28ed0e971a1187f90a3e273f642.tar.bz2
Expect unicode in class_name.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/typeobject.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index ab86f54..4fc51a6 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -1010,7 +1010,7 @@ class_name(PyObject *cls)
}
if (name == NULL)
return NULL;
- if (!PyString_Check(name)) {
+ if (!PyUnicode_Check(name)) {
Py_DECREF(name);
return NULL;
}
@@ -1032,7 +1032,7 @@ check_duplicates(PyObject *list)
o = class_name(o);
PyErr_Format(PyExc_TypeError,
"duplicate base class %s",
- o ? PyString_AS_STRING(o) : "?");
+ o ? PyUnicode_AsString(o) : "?");
Py_XDECREF(o);
return -1;
}
@@ -1078,7 +1078,7 @@ consistent method resolution\norder (MRO) for bases");
while (PyDict_Next(set, &i, &k, &v) && (size_t)off < sizeof(buf)) {
PyObject *name = class_name(k);
off += PyOS_snprintf(buf + off, sizeof(buf) - off, " %s",
- name ? PyString_AS_STRING(name) : "?");
+ name ? PyUnicode_AsString(name) : "?");
Py_XDECREF(name);
if (--n && (size_t)(off+1) < sizeof(buf)) {
buf[off++] = ',';