Add API for static strings, primarily good for identifiers.

Thanks to Konrad Schöbel and Jasper Schulz for helping with the mass-editing.
This commit is contained in:
Martin v. Löwis 2011-10-09 10:38:36 +02:00
parent 67df285a33
commit afe55bba33
50 changed files with 578 additions and 240 deletions

View file

@ -462,6 +462,7 @@ static int
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 @@ fp_setreadl(struct tok_state *tok, const char* enc)
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;