mirror of
https://github.com/python/cpython.git
synced 2025-07-08 03:45:36 +00:00
bpo-32381: Add _PyRun_SimpleFileObject() (GH-23709)
pymain_run_startup() now pass the filename as a Python object to _PyRun_SimpleFileObject().
This commit is contained in:
parent
98a5417193
commit
550e4673be
3 changed files with 25 additions and 33 deletions
|
@ -350,9 +350,9 @@ set_main_loader(PyObject *d, PyObject *filename, const char *loader_name)
|
|||
}
|
||||
|
||||
|
||||
static int
|
||||
pyrun_simple_file(FILE *fp, PyObject *filename, int closeit,
|
||||
PyCompilerFlags *flags)
|
||||
int
|
||||
_PyRun_SimpleFileObject(FILE *fp, PyObject *filename, int closeit,
|
||||
PyCompilerFlags *flags)
|
||||
{
|
||||
PyObject *m, *d, *v;
|
||||
int set_file_name = 0, ret = -1;
|
||||
|
@ -441,7 +441,7 @@ PyRun_SimpleFileExFlags(FILE *fp, const char *filename, int closeit,
|
|||
if (filename_obj == NULL) {
|
||||
return -1;
|
||||
}
|
||||
int res = pyrun_simple_file(fp, filename_obj, closeit, flags);
|
||||
int res = _PyRun_SimpleFileObject(fp, filename_obj, closeit, flags);
|
||||
Py_DECREF(filename_obj);
|
||||
return res;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue