summaryrefslogtreecommitdiff
path: root/Demo
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2008-10-30 21:48:26 +0000
committerChristian Heimes <christian@cheimes.de>2008-10-30 21:48:26 +0000
commit6a27efa2d321c2b262c0cab3c2d4af3e2e8a9ead (patch)
tree8b5388600b6df266a89b8ec1324ae6441cfbd032 /Demo
parent5833a2f6fdc6ee58b23a02380093bf1bfb015f3c (diff)
downloadcpython-git-6a27efa2d321c2b262c0cab3c2d4af3e2e8a9ead.tar.gz
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')
-rw-r--r--Demo/embed/importexc.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/Demo/embed/importexc.c b/Demo/embed/importexc.c
index 375ce1b686..59b1d01d87 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();