Commit 6e1d6c80 authored by Alexander Wiebel's avatar Alexander Wiebel

[FIX] make it compile with modern python binding

parent fbf5410b
......@@ -179,7 +179,15 @@ void WScriptInterpreterPython::setParameters( std::vector< std::string > const&
m_argv[ k ][ params[ k ].length() ] = '\0';
}
PySys_SetArgv( m_argc, m_argv );
// Needed for python 3
wchar_t** w_argv = static_cast<wchar_t**>( PyMem_Malloc(sizeof(wchar_t*)*m_argc) );
for( int i = 0; i < m_argc; ++i )
{
wchar_t* arg = Py_DecodeLocale( m_argv[i], NULL );
w_argv[i] = arg;
}
PySys_SetArgv( m_argc, w_argv );
}
void WScriptInterpreterPython::execute( std::string const& line )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment