mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
Use identifier API for PyObject_GetAttrString.
This commit is contained in:
parent
794d567b17
commit
1ee1b6fe0d
28 changed files with 499 additions and 357 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue