summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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>",