]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Support unicode names
authorNeal Norwitz <nnorwitz@gmail.com>
Sat, 25 Aug 2007 08:13:40 +0000 (08:13 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Sat, 25 Aug 2007 08:13:40 +0000 (08:13 +0000)
Objects/weakrefobject.c

index 6dc7d081768ed6c712f60d5d10a65e9ec6cb3fe1..8c324f3c81254ecc9beb0e33bc32429ec56d2eb5 100644 (file)
@@ -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>",