1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-03 04:23:50 +03:00

r26594: Add right paths to the Python sys.path setting so we don't have to set magic environment variables when running from the build directory.

This commit is contained in:
Jelmer Vernooij
2007-12-25 16:36:36 -06:00
committed by Stefan Metzmacher
parent 150cf39fbd
commit 2d2674ad79
2 changed files with 15 additions and 0 deletions

View File

@@ -43,3 +43,11 @@ void py_load_samba_modules(void)
PyImport_ExtendInittab(&py_modules[i]);
}
}
void py_update_path(const char *bindir)
{
char *newpath;
asprintf(&newpath, "%s:%s/python:%s/../scripting/python", Py_GetPath(), bindir, bindir);
PySys_SetPath(newpath);
free(newpath);
}