diff options
author | Victor Stinner <vstinner@python.org> | 2020-12-08 23:32:54 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-08 23:32:54 (GMT) |
commit | 550e4673be538d98b6ddf5550b3922539cf5c4b2 (patch) | |
tree | db27471f32ea5a682cb6f73004552d7dd64a23d0 /Python/pythonrun.c | |
parent | 98a54171932584883cb3973f78dd30f92d7a3a78 (diff) | |
download | cpython-550e4673be538d98b6ddf5550b3922539cf5c4b2.zip cpython-550e4673be538d98b6ddf5550b3922539cf5c4b2.tar.gz cpython-550e4673be538d98b6ddf5550b3922539cf5c4b2.tar.bz2 |
bpo-32381: Add _PyRun_SimpleFileObject() (GH-23709)
pymain_run_startup() now pass the filename as a Python object to
_PyRun_SimpleFileObject().
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r-- | Python/pythonrun.c | 8 |
1 files changed, 4 insertions, 4 deletions
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 @@ 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; } |