mirror of
https://github.com/python/cpython.git
synced 2025-11-03 03:22:27 +00:00
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:
parent
67df285a33
commit
afe55bba33
50 changed files with 578 additions and 240 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue