Kaydet (Commit) f616b224 authored tarafından Neal Norwitz's avatar Neal Norwitz

Support unicode names

üst b4e2f76d
...@@ -166,8 +166,8 @@ weakref_repr(PyWeakReference *self) ...@@ -166,8 +166,8 @@ weakref_repr(PyWeakReference *self)
"__name__"); "__name__");
if (nameobj == NULL) if (nameobj == NULL)
PyErr_Clear(); PyErr_Clear();
else if (PyString_Check(nameobj)) else if (PyUnicode_Check(nameobj))
name = PyString_AS_STRING(nameobj); name = PyUnicode_AsString(nameobj);
PyOS_snprintf(buffer, sizeof(buffer), PyOS_snprintf(buffer, sizeof(buffer),
name ? "<weakref at %p; to '%.50s' at %p (%s)>" name ? "<weakref at %p; to '%.50s' at %p (%s)>"
: "<weakref at %p; to '%.50s' at %p>", : "<weakref at %p; to '%.50s' at %p>",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment