diff options
author | Barry Warsaw <barry@python.org> | 2001-01-31 22:27:51 (GMT) |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 2001-01-31 22:27:51 (GMT) |
commit | f9abaf42f840cb5c3c60a1052177209072b885cb (patch) | |
tree | e8bf2149336a117dc920c9a66af434d3ea552345 /Demo/embed | |
parent | 2df3c41e78cb77ac940cb8e0950a5d0c67c95508 (diff) | |
download | cpython-f9abaf42f840cb5c3c60a1052177209072b885cb.zip cpython-f9abaf42f840cb5c3c60a1052177209072b885cb.tar.gz cpython-f9abaf42f840cb5c3c60a1052177209072b885cb.tar.bz2 |
Simple embedded program that does a module import. Useful for
debugging leaks and other memory problems.
Diffstat (limited to 'Demo/embed')
-rw-r--r-- | Demo/embed/import.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Demo/embed/import.c b/Demo/embed/import.c new file mode 100644 index 0000000..375ce1b --- /dev/null +++ b/Demo/embed/import.c @@ -0,0 +1,17 @@ +#include <Python.h> + +char* cmd = "import exceptions"; + +int main() +{ + Py_Initialize(); + PyEval_InitThreads(); + PyRun_SimpleString(cmd); + Py_EndInterpreter(PyThreadState_Get()); + + Py_NewInterpreter(); + PyRun_SimpleString(cmd); + Py_Finalize(); + + return 0; +} |