mirror of
https://github.com/python/cpython.git
synced 2025-12-09 18:48:05 +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
|
|
@ -2699,13 +2699,15 @@ static PyObject *
|
|||
bytearray_reduce(PyByteArrayObject *self)
|
||||
{
|
||||
PyObject *latin1, *dict;
|
||||
_Py_identifier(__dict__);
|
||||
|
||||
if (self->ob_bytes)
|
||||
latin1 = PyUnicode_DecodeLatin1(self->ob_bytes,
|
||||
Py_SIZE(self), NULL);
|
||||
else
|
||||
latin1 = PyUnicode_FromString("");
|
||||
|
||||
dict = PyObject_GetAttrString((PyObject *)self, "__dict__");
|
||||
dict = _PyObject_GetAttrId((PyObject *)self, &PyId___dict__);
|
||||
if (dict == NULL) {
|
||||
PyErr_Clear();
|
||||
dict = Py_None;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue