summaryrefslogtreecommitdiff
path: root/Include/pythonrun.h
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2000-08-27 19:21:52 +0000
committerGuido van Rossum <guido@python.org>2000-08-27 19:21:52 +0000
commit9825aeaec891b74fb4497da8f5ac932540fa2a1b (patch)
tree5b12cbc0d2d0487863cd2604a8118d768efb5fac /Include/pythonrun.h
parent5776f5504018fccc3f714f2e0b477ce568eac7bb (diff)
downloadcpython-9825aeaec891b74fb4497da8f5ac932540fa2a1b.tar.gz
Add three new APIs: PyRun_AnyFileEx(), PyRun_SimpleFileEx(),
PyRun_FileEx(). These are the same as their non-Ex counterparts but have an extra argument, a flag telling them to close the file when done. Then this is used by Py_Main() and execfile() to close the file after it is parsed but before it is executed. Adding APIs seems strange given the feature freeze but it's the only way I see to close the bug report without incompatible changes. [ Bug #110616 ] source file stays open after parsing is done (PR#209)
Diffstat (limited to 'Include/pythonrun.h')
-rw-r--r--Include/pythonrun.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/Include/pythonrun.h b/Include/pythonrun.h
index 05287021aa..bbf2903a39 100644
--- a/Include/pythonrun.h
+++ b/Include/pythonrun.h
@@ -29,9 +29,11 @@ DL_IMPORT(PyThreadState *) Py_NewInterpreter(void);
DL_IMPORT(void) Py_EndInterpreter(PyThreadState *);
DL_IMPORT(int) PyRun_AnyFile(FILE *, char *);
+DL_IMPORT(int) PyRun_AnyFileEx(FILE *, char *, int);
DL_IMPORT(int) PyRun_SimpleString(char *);
DL_IMPORT(int) PyRun_SimpleFile(FILE *, char *);
+DL_IMPORT(int) PyRun_SimpleFileEx(FILE *, char *, int);
DL_IMPORT(int) PyRun_InteractiveOne(FILE *, char *);
DL_IMPORT(int) PyRun_InteractiveLoop(FILE *, char *);
@@ -40,6 +42,8 @@ DL_IMPORT(struct _node *) PyParser_SimpleParseFile(FILE *, char *, int);
DL_IMPORT(PyObject *) PyRun_String(char *, int, PyObject *, PyObject *);
DL_IMPORT(PyObject *) PyRun_File(FILE *, char *, int, PyObject *, PyObject *);
+DL_IMPORT(PyObject *) PyRun_FileEx(FILE *, char *, int,
+ PyObject *, PyObject *, int);
DL_IMPORT(PyObject *) Py_CompileString(char *, char *, int);