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/Objects/fileobject.c b/Objects/fileobject.c
index 6421543..f3006d0 100644
--- a/Objects/fileobject.c
+++ b/Objects/fileobject.c
@@ -30,11 +30,12 @@
char *errors, char *newline, int closefd)
{
PyObject *io, *stream;
+ _Py_identifier(open);
io = PyImport_ImportModule("io");
if (io == NULL)
return NULL;
- stream = PyObject_CallMethod(io, "open", "isisssi", fd, mode,
+ stream = _PyObject_CallMethodId(io, &PyId_open, "isisssi", fd, mode,
buffering, encoding, errors,
newline, closefd);
Py_DECREF(io);