1
0
mirror of https://github.com/samba-team/samba.git synced 2025-07-25 00:59:11 +03:00

s4-python Don't force "bin" into the python sys.path

This patch uses the fact that dyn_PYTHONDIR and dyn_PYTHONARCHDIR is
now set properly at all times, incluidng for installed and
build-directory binaries.  So we don't need to make assumptions about
bin being magic any more.

Andrew Bartlett
This commit is contained in:
Andrew Bartlett
2011-02-05 18:00:45 +11:00
committed by Andrew Tridgell
parent 19c3546872
commit 15d0166340
5 changed files with 8 additions and 25 deletions

View File

@ -31,7 +31,7 @@ static bool PySys_PathPrepend(PyObject *list, const char *path)
return (PyList_Insert(list, 0, py_path) == 0);
}
bool py_update_path(const char *bindir)
bool py_update_path()
{
char *newpath;
PyObject *mod_sys, *py_path;
@ -58,23 +58,5 @@ bool py_update_path(const char *bindir)
return false;
}
if (asprintf(&newpath, "%s/../scripting/python", bindir) < 0) {
return false;
}
if (!PySys_PathPrepend(py_path, newpath)) {
free(newpath);
return false;
}
free(newpath);
if (asprintf(&newpath, "%s/python", bindir) < 0) {
return false;
}
if (!PySys_PathPrepend(py_path, newpath)) {
free(newpath);
return false;
}
free(newpath);
return true;
}

View File

@ -20,6 +20,6 @@
#ifndef __SAMBA_PYTHON_MODULES_H__
#define __SAMBA_PYTHON_MODULES_H__
bool py_update_path(const char *bindir);
bool py_update_path();
#endif /* __SAMBA_PYTHON_MODULES_H__ */