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

walter.doerwald python-3000-checkins at python.org
Mon Jun 11 16:03:54 CEST 2007


Author: walter.doerwald
Date: Mon Jun 11 16:03:45 2007
New Revision: 55891

Modified:
   python/branches/py3k-struni/Objects/typeobject.c
Log:
__module__ is a unicode string now:
use PyUnicode_CompareWithASCIIString() instead of
strcmp().

Simplify repr formatting.


Modified: python/branches/py3k-struni/Objects/typeobject.c
==============================================================================
--- python/branches/py3k-struni/Objects/typeobject.c	(original)
+++ python/branches/py3k-struni/Objects/typeobject.c	Mon Jun 11 16:03:45 2007
@@ -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);


More information about the Python-3000-checkins mailing list