summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorWalter Dörwald <walter@livinglogic.de>2007-06-11 14:03:45 (GMT)
committerWalter Dörwald <walter@livinglogic.de>2007-06-11 14:03:45 (GMT)
commit4dbd01b43506ead947f774bcfdddf52219f862f0 (patch)
tree01788df03ac0898b11ea2486e0dc23ac530f4e6a /Objects
parent641d5cc6a61e19a01d62b61b6b5b5d9dd8663d12 (diff)
downloadcpython-4dbd01b43506ead947f774bcfdddf52219f862f0.zip
cpython-4dbd01b43506ead947f774bcfdddf52219f862f0.tar.gz
cpython-4dbd01b43506ead947f774bcfdddf52219f862f0.tar.bz2
__module__ is a unicode string now:
use PyUnicode_CompareWithASCIIString() instead of strcmp(). Simplify repr formatting.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/typeobject.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 4fc51a6..bc5fad1 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -2479,11 +2479,8 @@ object_repr(PyObject *self)
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);