diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-01-11 14:11:21 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-01-11 14:11:21 +0300 |
commit | ebb9286fd65d3cb1aae001080dbdb7102e7b49bf (patch) | |
tree | 53998e4c840b67abd52bf315b7f90474b57a3d09 /source/blender/python/intern | |
parent | a3e461ce1b863b783219c5488182a4aa66b3e9f7 (diff) |
Fix for cmake + windows debug build crash on startup, PYTHONPATH needs to be set, Py_SetPythonHome seems insufficient. Not sure why this is needed or if there is a better solution, but couldn't find another one.
Diffstat (limited to 'source/blender/python/intern')
-rw-r--r-- | source/blender/python/intern/bpy_interface.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index 2c1edc965e9..611521073ef 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -299,9 +299,20 @@ void BPY_start_python_path(void) \nThis may make python import function fail\n"); #endif -#if 0 - BLI_setenv("PYTHONHOME", py_path_bundle); - BLI_setenv("PYTHONPATH", py_path_bundle); +#ifdef _WIN32 + /* cmake/MSVC debug build crashes without this, why only + in this case is unknown.. */ + { + char *envpath = getenv("PYTHONPATH"); + + if(envpath && envpath[0]) { + char *newenvpath = BLI_sprintfN("%s;%s", py_path_bundle, envpath); + BLI_setenv("PYTHONPATH", newenvpath); + MEM_freeN(newenvpath); + } + else + BLI_setenv("PYTHONPATH", py_path_bundle); + } #endif { |