diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2007-08-25 08:13:40 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2007-08-25 08:13:40 (GMT) |
commit | f616b224506ef17ac9ab4378c92b99ae816b88f7 (patch) | |
tree | 4053b66f03b3b4d1744d7d8e82a2ac930851854e | |
parent | b4e2f76d240a5a03d65d6e14f0c868c3bc805fb9 (diff) | |
download | cpython-f616b224506ef17ac9ab4378c92b99ae816b88f7.zip cpython-f616b224506ef17ac9ab4378c92b99ae816b88f7.tar.gz cpython-f616b224506ef17ac9ab4378c92b99ae816b88f7.tar.bz2 |
Support unicode names
-rw-r--r-- | Objects/weakrefobject.c | 4 |
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>", |