Make sure to only call Py_Initialize if Python is not initialized.
This commit is contained in:
parent
553062fc11
commit
0f734c8c5c
@ -189,7 +189,8 @@ Helper::Helper( QObject* parent )
|
|||||||
// Let's make extra sure we only call Py_Initialize once
|
// Let's make extra sure we only call Py_Initialize once
|
||||||
if ( !s_instance )
|
if ( !s_instance )
|
||||||
{
|
{
|
||||||
Py_Initialize();
|
if ( !Py_IsInitialized() )
|
||||||
|
Py_Initialize();
|
||||||
|
|
||||||
m_mainModule = bp::import( "__main__" );
|
m_mainModule = bp::import( "__main__" );
|
||||||
m_mainNamespace = m_mainModule.attr( "__dict__" );
|
m_mainNamespace = m_mainModule.attr( "__dict__" );
|
||||||
|
Loading…
Reference in New Issue
Block a user