[Python-3000-checkins] r55862 - python/branches/py3k-struni/Objects/typeobject.c

martin.v.loewis python-3000-checkins at python.org
Sun Jun 10 23:13:37 CEST 2007


Author: martin.v.loewis
Date: Sun Jun 10 23:13:34 2007
New Revision: 55862

Modified:
   python/branches/py3k-struni/Objects/typeobject.c
Log:
Expect unicode in class_name.


Modified: python/branches/py3k-struni/Objects/typeobject.c
==============================================================================
--- python/branches/py3k-struni/Objects/typeobject.c	(original)
+++ python/branches/py3k-struni/Objects/typeobject.c	Sun Jun 10 23:13:34 2007
@@ -1010,7 +1010,7 @@
 	}
 	if (name == NULL)
 		return NULL;
-	if (!PyString_Check(name)) {
+	if (!PyUnicode_Check(name)) {
 		Py_DECREF(name);
 		return NULL;
 	}
@@ -1032,7 +1032,7 @@
 				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 @@
 	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++] = ',';


More information about the Python-3000-checkins mailing list