summaryrefslogtreecommitdiffstats
path: root/Objects/weakrefobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/weakrefobject.c')
-rw-r--r--Objects/weakrefobject.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Objects/weakrefobject.c b/Objects/weakrefobject.c
index 594f0ea..374e720 100644
--- a/Objects/weakrefobject.c
+++ b/Objects/weakrefobject.c
@@ -157,11 +157,12 @@ static PyObject *
weakref_repr(PyWeakReference *self)
{
PyObject *name, *repr;
+ _Py_identifier(__name__);
if (PyWeakref_GET_OBJECT(self) == Py_None)
return PyUnicode_FromFormat("<weakref at %p; dead>", self);
- name = PyObject_GetAttrString(PyWeakref_GET_OBJECT(self), "__name__");
+ name = _PyObject_GetAttrId(PyWeakref_GET_OBJECT(self), &PyId___name__);
if (name == NULL || !PyUnicode_Check(name)) {
if (name == NULL)
PyErr_Clear();