mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Replace {Get,Set,Has}AttrString with *AttrId.
This commit is contained in:
parent
7903913fa6
commit
767046aab1
5 changed files with 25 additions and 14 deletions
|
@ -993,12 +993,13 @@ mode_string(fileio *self)
|
|||
static PyObject *
|
||||
fileio_repr(fileio *self)
|
||||
{
|
||||
_Py_IDENTIFIER(name);
|
||||
PyObject *nameobj, *res;
|
||||
|
||||
if (self->fd < 0)
|
||||
return PyUnicode_FromFormat("<_io.FileIO [closed]>");
|
||||
|
||||
nameobj = PyObject_GetAttrString((PyObject *) self, "name");
|
||||
nameobj = _PyObject_GetAttrId((PyObject *) self, &PyId_name);
|
||||
if (nameobj == NULL) {
|
||||
if (PyErr_ExceptionMatches(PyExc_AttributeError))
|
||||
PyErr_Clear();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue