bpo-32381: Add _PyRun_SimpleFileObject() (GH-23709)
pymain_run_startup() now pass the filename as a Python object to
_PyRun_SimpleFileObject().
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index 330b822..15e407d 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -350,9 +350,9 @@
}
-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 @@
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;
}