[Python-checkins] cpython (3.2): Issue #12090: backport 79fcd71d0356

stefan.krah python-checkins at python.org
Thu May 26 00:40:20 CEST 2011


http://hg.python.org/cpython/rev/bb8bb4db2bc5
changeset:   70392:bb8bb4db2bc5
branch:      3.2
parent:      70386:fb29dc650d24
user:        Stefan Krah <skrah at bytereef.org>
date:        Thu May 26 00:37:45 2011 +0200
summary:
  Issue #12090: backport 79fcd71d0356

files:
  Modules/_testembed.c |  6 ++++++
  1 files changed, 6 insertions(+), 0 deletions(-)


diff --git a/Modules/_testembed.c b/Modules/_testembed.c
--- a/Modules/_testembed.c
+++ b/Modules/_testembed.c
@@ -17,7 +17,9 @@
 int main(int argc, char *argv[])
 {
     PyThreadState *mainstate, *substate;
+#ifdef WITH_THREAD
     PyGILState_STATE gilstate;
+#endif
     int i, j;
 
     for (i=0; i<3; i++) {
@@ -28,10 +30,12 @@
         Py_Initialize();
         mainstate = PyThreadState_Get();
 
+#ifdef WITH_THREAD
         PyEval_InitThreads();
         PyEval_ReleaseThread(mainstate);
 
         gilstate = PyGILState_Ensure();
+#endif
         print_subinterp();
         PyThreadState_Swap(NULL);
 
@@ -43,7 +47,9 @@
 
         PyThreadState_Swap(mainstate);
         print_subinterp();
+#ifdef WITH_THREAD
         PyGILState_Release(gilstate);
+#endif
 
         PyEval_RestoreThread(mainstate);
         Py_Finalize();

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list