diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-05-18 14:19:49 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-05-18 14:19:49 +0400 |
commit | 181f3670c904efe662444d0e542ea8234f7571a9 (patch) | |
tree | b1e5ba1425e4e5a4271d22cbafcf945dc72cf7db /source/gameengine | |
parent | f55b6a53316de21fc080fd3538b84376a6d4e41a (diff) |
patch [#31507] site not automatically imported when using external python package
made some modificatons to normal python startup also.
Diffstat (limited to 'source/gameengine')
-rw-r--r-- | source/gameengine/Ketsji/KX_PythonInit.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index a7078860da3..28c4630c43e 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -1843,19 +1843,24 @@ PyObject* initGamePlayerPythonScripting(const STR_String& progname, TPythonSecur * somehow it remembers the sys.path - Campbell */ static bool first_time = true; - + char *py_path_bundle = BLI_get_folder(BLENDER_SYSTEM_PYTHON, NULL); + #if 0 // TODO - py3 STR_String pname = progname; Py_SetProgramName(pname.Ptr()); #endif - Py_NoSiteFlag=1; - Py_FrozenFlag=1; + + if (py_path_bundle != NULL) { + Py_NoSiteFlag = 1; + } + + Py_FrozenFlag = 1; /* must run before python initializes */ PyImport_ExtendInittab(bge_internal_modules); /* find local python installation */ - PyC_SetHomePath(BLI_get_folder(BLENDER_SYSTEM_PYTHON, NULL)); + PyC_SetHomePath(py_path_bundle); Py_Initialize(); @@ -1929,8 +1934,6 @@ PyObject* initGamePythonScripting(const STR_String& progname, TPythonSecurityLev STR_String pname = progname; Py_SetProgramName(pname.Ptr()); #endif - Py_NoSiteFlag=1; - Py_FrozenFlag=1; #ifdef WITH_AUDASPACE /* accessing a SoundActuator's sound results in a crash if aud is not initialized... */ |