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/Parser/tokenizer.c b/Parser/tokenizer.c
index a0a3a67..23ea2eb 100644
--- a/Parser/tokenizer.c
+++ b/Parser/tokenizer.c
@@ -462,6 +462,7 @@
fp_setreadl(struct tok_state *tok, const char* enc)
{
PyObject *readline = NULL, *stream = NULL, *io = NULL;
+ _Py_identifier(open);
int fd;
io = PyImport_ImportModuleNoBlock("io");
@@ -474,7 +475,7 @@
goto cleanup;
}
- stream = PyObject_CallMethod(io, "open", "isisOOO",
+ stream = _PyObject_CallMethodId(io, &PyId_open, "isisOOO",
fd, "r", -1, enc, Py_None, Py_None, Py_False);
if (stream == NULL)
goto cleanup;