MSVC: don't set python home when running from build dir

This allows you to specify your python home via the
environment and get a working python setup when running
in-place.
This commit is contained in:
Jon Evans 2021-02-14 09:33:57 -05:00
parent bbe315bcb8
commit 1ab17dd2e7
1 changed files with 4 additions and 1 deletions

View File

@ -179,7 +179,10 @@ bool pcbnewInitPythonScripting( const char* aStockScriptingPath, const char* aUs
pyHome.Normalize();
// MUST be called before Py_Initialize so it will to create valid default lib paths
Py_SetPythonHome( pyHome.GetFullPath().c_str() );
if( !wxGetEnv( wxT( "KICAD_RUN_FROM_BUILD_DIR" ), nullptr ) )
{
Py_SetPythonHome( pyHome.GetFullPath().c_str() );
}
#endif
Py_Initialize();