6 May
2010
6 May
'10
11:09 a.m.
I am getting a SIGABRT PyImport_GetModuleDict: no module dictionary!"
this is the code.
I need a InterpreterState because I need to create new threads using pthread and clone the existing state.
Does PyInterpreterState_New, create a fulling initalized IS? Does PyThreadState_New clone the existing state or a clean new one?
Py_Initialize();
is = PyInterpreterState_New();
if ( is == NULL ) {
fclose ( maa->pFILE);
free( maa );
return -2;
}
maa->is = is;
PyEval_InitThreads();
ts = PyThreadState_New(is);
PyThreadState_Swap( ts );
ts = PyThreadState_Get();
maa->ts = ts;
PyImport_ImportModule( "sys" );