summaryrefslogtreecommitdiffstats
path: root/Modules/_io/fileio.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/_io/fileio.c')
-rw-r--r--Modules/_io/fileio.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/_io/fileio.c b/Modules/_io/fileio.c
index e3c0dd9..7364523 100644
--- a/Modules/_io/fileio.c
+++ b/Modules/_io/fileio.c
@@ -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();