mirror of
https://github.com/AdaCore/cpython.git
synced 2026-02-12 12:57:15 -08: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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user