1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-03 01:18:10 +03:00

s4-python: added PYTHONDIR to python search path

we put it after the scripting/python dir, so we look in the build
directory (if applicable) first.
This commit is contained in:
Andrew Tridgell 2010-04-20 20:24:08 +10:00
parent 6072ab0d57
commit 1f7da85c77

View File

@ -20,6 +20,7 @@
#include <Python.h> #include <Python.h>
#include "includes.h" #include "includes.h"
#include "scripting/python/modules.h" #include "scripting/python/modules.h"
#include "dynconfig/dynconfig.h"
extern void init_ldb(void); extern void init_ldb(void);
extern void init_security(void); extern void init_security(void);
@ -89,6 +90,10 @@ bool py_update_path(const char *bindir)
return false; return false;
} }
if (!PySys_PathPrepend(py_path, dyn_PYTHONDIR)) {
return false;
}
asprintf(&newpath, "%s/../scripting/python", bindir); asprintf(&newpath, "%s/../scripting/python", bindir);
if (!PySys_PathPrepend(py_path, newpath)) { if (!PySys_PathPrepend(py_path, newpath)) {
free(newpath); free(newpath);