Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-05-18 14:19:49 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-05-18 14:19:49 +0400
commit181f3670c904efe662444d0e542ea8234f7571a9 (patch)
treeb1e5ba1425e4e5a4271d22cbafcf945dc72cf7db /source/blender/python
parentf55b6a53316de21fc080fd3538b84376a6d4e41a (diff)
patch [#31507] site not automatically imported when using external python package
made some modificatons to normal python startup also.
Diffstat (limited to 'source/blender/python')
-rw-r--r--source/blender/python/intern/bpy_interface.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c
index f3f05e93930..b9d4c1ae94f 100644
--- a/source/blender/python/intern/bpy_interface.c
+++ b/source/blender/python/intern/bpy_interface.c
@@ -223,6 +223,7 @@ void BPY_python_start(int argc, const char **argv)
{
#ifndef WITH_PYTHON_MODULE
PyThreadState *py_tstate = NULL;
+ const char *py_path_bundle = BLI_get_folder(BLENDER_SYSTEM_PYTHON, NULL);
/* not essential but nice to set our name */
static wchar_t program_path_wchar[FILE_MAX]; /* python holds a reference */
@@ -233,7 +234,7 @@ void BPY_python_start(int argc, const char **argv)
PyImport_ExtendInittab(bpy_internal_modules);
/* allow to use our own included python */
- PyC_SetHomePath(BLI_get_folder(BLENDER_SYSTEM_PYTHON, NULL));
+ PyC_SetHomePath(py_path_bundle);
/* without this the sys.stdout may be set to 'ascii'
* (it is on my system at least), where printing unicode values will raise
@@ -245,7 +246,11 @@ void BPY_python_start(int argc, const char **argv)
/* Python 3.2 now looks for '2.xx/python/include/python3.2d/pyconfig.h' to
* parse from the 'sysconfig' module which is used by 'site',
* so for now disable site. alternatively we could copy the file. */
- Py_NoSiteFlag = 1;
+ if (py_path_bundle) {
+ Py_NoSiteFlag = 1;
+ }
+
+ Py_FrozenFlag = 1;
Py_Initialize();