Add API for static strings, primarily good for identifiers.
Thanks to Konrad Schöbel and Jasper Schulz for helping with the mass-editing.
diff --git a/Modules/_io/fileio.c b/Modules/_io/fileio.c
index 2bf8933..a16d13c 100644
--- a/Modules/_io/fileio.c
+++ b/Modules/_io/fileio.c
@@ -128,6 +128,7 @@
static PyObject *
fileio_close(fileio *self)
{
+ _Py_identifier(close);
if (!self->closefd) {
self->fd = -1;
Py_RETURN_NONE;
@@ -143,8 +144,8 @@
if (errno < 0)
return NULL;
- return PyObject_CallMethod((PyObject*)&PyRawIOBase_Type,
- "close", "O", self);
+ return _PyObject_CallMethodId((PyObject*)&PyRawIOBase_Type,
+ &PyId_close, "O", self);
}
static PyObject *