From 1d966b8bea572df550d00b2c75db186c41700d48 Mon Sep 17 00:00:00 2001 From: stv Date: Thu, 21 Jun 2007 07:15:37 +0000 Subject: [PATCH] *** empty log message *** --- src/PyConsole/PyConsole_Interp.cxx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/PyConsole/PyConsole_Interp.cxx b/src/PyConsole/PyConsole_Interp.cxx index a2c0d47a9..b71c02178 100644 --- a/src/PyConsole/PyConsole_Interp.cxx +++ b/src/PyConsole/PyConsole_Interp.cxx @@ -79,9 +79,27 @@ bool PyConsole_Interp::initState() { // The GIL is acquired and will be held on initState output // It is the caller responsability to release the lock if needed + +/* LLS PyEval_AcquireLock(); _tstate = Py_NewInterpreter(); // create an interpreter and save current state PySys_SetArgv(PyInterp_base::_argc,PyInterp_base::_argv); // initialize sys.argv +*/ + + PyEval_AcquireLock(); +#ifdef WIN32 + _tstate = PyGILState_GetThisThreadState(); + // if no thread state defined + if ( _tstate ) + PyThreadState_Swap(_tstate); + else +#endif + { + _tstate = Py_NewInterpreter(); // create an interpreter and save current state + PySys_SetArgv(PyInterp_base::_argc,PyInterp_base::_argv); // initialize sys.argv + //if(MYDEBUG) MESSAGE("PythonConsole_PyInterp::initState - this = "<