mirror of
https://github.com/python/cpython.git
synced 2025-09-03 23:41:18 +00:00
It's unclear whether PyMarshal_XXX() are part of the public or private API.
They're named as if public, so I did a Bad Thing by changing PyMarshal_ReadObjectFromFile() to suck up the remainder of the file in one gulp: anyone who counted on that leaving the file pointer merely at the end of the next object would be screwed. So restored PyMarshal_ReadObjectFromFile() to its earlier state, renamed the new greedy code to PyMarshal_ReadLastObjectFromFile(), and changed Python internals to call the latter instead.
This commit is contained in:
parent
09ac1fde1c
commit
d9b9ac855c
4 changed files with 52 additions and 35 deletions
|
@ -936,7 +936,7 @@ run_pyc_file(FILE *fp, char *filename, PyObject *globals, PyObject *locals)
|
|||
return NULL;
|
||||
}
|
||||
(void) PyMarshal_ReadLongFromFile(fp);
|
||||
v = PyMarshal_ReadObjectFromFile(fp);
|
||||
v = PyMarshal_ReadLastObjectFromFile(fp);
|
||||
fclose(fp);
|
||||
if (v == NULL || !PyCode_Check(v)) {
|
||||
Py_XDECREF(v);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue