diff Objects/typeobject.c @ 42036:160b7318a3ca

__module__ is a unicode string now: use PyUnicode_CompareWithASCIIString() instead of strcmp(). Simplify repr formatting.
author Walter Dörwald <walter@livinglogic.de>
date Mon, 11 Jun 2007 14:03:45 +0000
parents f5b65731bd6c
children 180846b8755f
line wrap: on
line diff
--- a/Objects/typeobject.c	Mon Jun 11 04:19:13 2007 +0000
+++ b/Objects/typeobject.c	Mon Jun 11 14:03:45 2007 +0000
@@ -2479,11 +2479,8 @@
 	name = type_name(type, NULL);
 	if (name == NULL)
 		return NULL;
-	if (mod != NULL && strcmp(PyString_AS_STRING(mod), "__builtin__"))
-		rtn = PyUnicode_FromFormat("<%s.%s object at %p>",
-					  PyUnicode_AsString(mod),
-					  PyUnicode_AsString(name),
-					  self);
+	if (mod != NULL && PyUnicode_CompareWithASCIIString(mod, "__builtin__"))
+		rtn = PyUnicode_FromFormat("<%U.%U object at %p>", mod, name, self);
 	else
 		rtn = PyUnicode_FromFormat("<%s object at %p>",
 					  type->tp_name, self);