summaryrefslogtreecommitdiff
path: root/source4/scripting/python/modules.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-12-25 16:36:36 -0600
committerStefan Metzmacher <metze@samba.org>2007-12-26 11:57:07 -0600
commite8bca8dd71c9bb64b84f6a74632a46a661be0d97 (patch)
treec3c4629832b1868335f603da4bf3c48d996e84ab /source4/scripting/python/modules.c
parent7c146c42d2cf51e891b9f29d3b61a40f173a3b23 (diff)
downloadsamba-e8bca8dd71c9bb64b84f6a74632a46a661be0d97.tar.gz
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 used to be commit 2d2674ad79330f59210408fd03e859afc01f40f2)
Diffstat (limited to 'source4/scripting/python/modules.c')
-rw-r--r--source4/scripting/python/modules.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source4/scripting/python/modules.c b/source4/scripting/python/modules.c
index 6a766f34120..2a888706602 100644
--- a/source4/scripting/python/modules.c
+++ b/source4/scripting/python/modules.c
@@ -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);
+}