summaryrefslogtreecommitdiffstats
path: root/Objects/weakrefobject.c
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2007-08-25 08:13:40 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2007-08-25 08:13:40 (GMT)
commitf616b224506ef17ac9ab4378c92b99ae816b88f7 (patch)
tree4053b66f03b3b4d1744d7d8e82a2ac930851854e /Objects/weakrefobject.c
parentb4e2f76d240a5a03d65d6e14f0c868c3bc805fb9 (diff)
downloadcpython-f616b224506ef17ac9ab4378c92b99ae816b88f7.zip
cpython-f616b224506ef17ac9ab4378c92b99ae816b88f7.tar.gz
cpython-f616b224506ef17ac9ab4378c92b99ae816b88f7.tar.bz2
Support unicode names
Diffstat (limited to 'Objects/weakrefobject.c')
-rw-r--r--Objects/weakrefobject.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/weakrefobject.c b/Objects/weakrefobject.c
index 6dc7d08..8c324f3 100644
--- a/Objects/weakrefobject.c
+++ b/Objects/weakrefobject.c
@@ -166,8 +166,8 @@ weakref_repr(PyWeakReference *self)
"__name__");
if (nameobj == NULL)
PyErr_Clear();
- else if (PyString_Check(nameobj))
- name = PyString_AS_STRING(nameobj);
+ else if (PyUnicode_Check(nameobj))
+ name = PyUnicode_AsString(nameobj);
PyOS_snprintf(buffer, sizeof(buffer),
name ? "<weakref at %p; to '%.50s' at %p (%s)>"
: "<weakref at %p; to '%.50s' at %p>",