Make sure to only call Py_Initialize if Python is not initialized.

This commit is contained in:
Teo Mrnjavac 2016-10-03 18:00:35 +02:00
parent 553062fc11
commit 0f734c8c5c

View file

@ -189,7 +189,8 @@ Helper::Helper( QObject* parent )
// Let's make extra sure we only call Py_Initialize once
if ( !s_instance )
{
Py_Initialize();
if ( !Py_IsInitialized() )
Py_Initialize();
m_mainModule = bp::import( "__main__" );
m_mainNamespace = m_mainModule.attr( "__dict__" );