From edd8c9ea2ab1e51d116135411df120ec1167e0e6 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 7 Feb 2011 09:45:26 +1100 Subject: s4-python: get ordering right on python paths we need to have PYTHONARCHDIR first, as that is where we currently install. That will minimise problems with upgrades from old installs. We also don't need to add the path twice if PYTHONDIR is the same as PYTHONARCHDIR (as happens on debian based systems) Pair-Programmed-With: Andrew Bartlett --- source4/scripting/python/modules.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'source4') diff --git a/source4/scripting/python/modules.c b/source4/scripting/python/modules.c index f2a45a9893..9c6a008558 100644 --- a/source4/scripting/python/modules.c +++ b/source4/scripting/python/modules.c @@ -50,12 +50,14 @@ bool py_update_path() return false; } - if (!PySys_PathPrepend(py_path, dyn_PYTHONARCHDIR)) { + if (!PySys_PathPrepend(py_path, dyn_PYTHONDIR)) { return false; } - if (!PySys_PathPrepend(py_path, dyn_PYTHONDIR)) { - return false; + if (strcmp(dyn_PYTHONARCHDIR, dyn_PYTHONDIR) != 0) { + if (!PySys_PathPrepend(py_path, dyn_PYTHONARCHDIR)) { + return false; + } } return true; -- cgit