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:
authorKen Hughes <khughes@pacific.edu>2005-10-30 21:27:24 +0300
committerKen Hughes <khughes@pacific.edu>2005-10-30 21:27:24 +0300
commit227e6b08b2d4159597bd6c7fbe97180c0c23250c (patch)
tree729e3ba3081ddaea806c2e5086dc6ea8b7beabfc /source/blender/python/BPY_interface.c
parentb483454bd33ebaa860def024fcb2508c42f297fc (diff)
-- testing a patch which lets Python initialize the site path for Blender
(old code is just "#ifdef"-ed out for now.) Please give this a try on all platforms and give us feedback on what you see for your sys.path setting in Blender (run these two lines in text window) import sys print sys.path
Diffstat (limited to 'source/blender/python/BPY_interface.c')
-rw-r--r--source/blender/python/BPY_interface.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/source/blender/python/BPY_interface.c b/source/blender/python/BPY_interface.c
index 979c2aa7a49..5cd96e85114 100644
--- a/source/blender/python/BPY_interface.c
+++ b/source/blender/python/BPY_interface.c
@@ -212,8 +212,7 @@ void init_syspath( int first_time )
{
PyObject *path;
PyObject *mod, *d;
- PyObject *p;
- char *c, *progname;
+ char *progname;
char execdir[FILE_MAXDIR]; /*defines from DNA_space_types.h */
int n;
@@ -231,8 +230,13 @@ void init_syspath( int first_time )
progname = BLI_last_slash( bprogname ); /* looks for the last dir separator */
- c = Py_GetPath( ); /* get python system path */
- PySys_SetPath( c ); /* initialize */
+#ifdef SETSYSPATH
+ {
+ char *c;
+ c = Py_GetPath( ); /* get python system path */
+ PySys_SetPath( c ); /* initialize */
+ }
+#endif
n = progname - bprogname;
if( n > 0 ) {
@@ -247,6 +251,7 @@ void init_syspath( int first_time )
} else
printf( "Warning: could not determine argv[0] path\n" );
+#ifdef SETSYSPATH
/*
* bring in the site module so we can add
* site-package dirs to sys.path
@@ -258,6 +263,7 @@ void init_syspath( int first_time )
PyObject *item;
int size = 0;
int index;
+ PyObject *p;
/* get the value of 'sitedirs' from the module */
@@ -285,6 +291,7 @@ void init_syspath( int first_time )
printf( "Continuing happily.\n" );
}
}
+#endif
/*
* initialize the sys module