diff options
author | Christian Heimes <christian@cheimes.de> | 2008-10-30 21:48:26 (GMT) |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2008-10-30 21:48:26 (GMT) |
commit | 6a27efa2d321c2b262c0cab3c2d4af3e2e8a9ead (patch) | |
tree | 8b5388600b6df266a89b8ec1324ae6441cfbd032 /Demo/embed | |
parent | 5833a2f6fdc6ee58b23a02380093bf1bfb015f3c (diff) | |
download | cpython-6a27efa2d321c2b262c0cab3c2d4af3e2e8a9ead.zip cpython-6a27efa2d321c2b262c0cab3c2d4af3e2e8a9ead.tar.gz cpython-6a27efa2d321c2b262c0cab3c2d4af3e2e8a9ead.tar.bz2 |
Issue 3723: Fixed initialization of subinterpreters
The patch fixes several issues with Py_NewInterpreter as well as the demo for multiple subinterpreters.
Most of the patch was written by MvL with help from Benjamin, Amaury and me. Graham Dumpleton has verified that this patch fixes an issue with mod_wsgi.
Diffstat (limited to 'Demo/embed')
-rw-r--r-- | Demo/embed/importexc.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Demo/embed/importexc.c b/Demo/embed/importexc.c index 375ce1b..59b1d01 100644 --- a/Demo/embed/importexc.c +++ b/Demo/embed/importexc.c @@ -1,14 +1,20 @@ #include <Python.h> -char* cmd = "import exceptions"; +#if 0 +char* cmd = "import codecs, encodings.utf_8, types; print(types)"; +#else +char* cmd = "import types; print(types)"; +#endif int main() { + printf("Initialize interpreter\n"); Py_Initialize(); PyEval_InitThreads(); PyRun_SimpleString(cmd); Py_EndInterpreter(PyThreadState_Get()); + printf("\nInitialize subinterpreter\n"); Py_NewInterpreter(); PyRun_SimpleString(cmd); Py_Finalize(); |