From: Victor Stinner Date: Tue, 26 Apr 2011 21:37:02 +0000 (+0200) Subject: Fix compilation of _testembed.c without threads X-Git-Tag: v3.3.0a1~2496 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=66299a49f0f5b3aab6ceed6cbdf94a6b89b70328;p=python Fix compilation of _testembed.c without threads --- diff --git a/Modules/_testembed.c b/Modules/_testembed.c index 0df5ede6e4..51b439f480 100644 --- a/Modules/_testembed.c +++ b/Modules/_testembed.c @@ -17,7 +17,9 @@ void print_subinterp(void) 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 @@ int main(int argc, char *argv[]) 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 @@ int main(int argc, char *argv[]) PyThreadState_Swap(mainstate); print_subinterp(); +#ifdef WITH_THREAD PyGILState_Release(gilstate); +#endif PyEval_RestoreThread(mainstate); Py_Finalize();