mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00: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
|
@ -1933,6 +1933,7 @@ static PyObject *
|
|||
set_reduce(PySetObject *so)
|
||||
{
|
||||
PyObject *keys=NULL, *args=NULL, *result=NULL, *dict=NULL;
|
||||
_Py_identifier(__dict__);
|
||||
|
||||
keys = PySequence_List((PyObject *)so);
|
||||
if (keys == NULL)
|
||||
|
@ -1940,7 +1941,7 @@ set_reduce(PySetObject *so)
|
|||
args = PyTuple_Pack(1, keys);
|
||||
if (args == NULL)
|
||||
goto done;
|
||||
dict = PyObject_GetAttrString((PyObject *)so, "__dict__");
|
||||
dict = _PyObject_GetAttrId((PyObject *)so, &PyId___dict__);
|
||||
if (dict == NULL) {
|
||||
PyErr_Clear();
|
||||
dict = Py_None;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue