python/samba/tests: make sure samba-tool is called with ${PYTHON}
[amitay/samba.git] / python / samba / tests / __init__.py
index 4ec3e31bcca73d72c8cb6839d36e63782e977547..ca278b5d1c7a0b8a84ebead62f3d4ff1767d466f 100644 (file)
@@ -371,7 +371,10 @@ class BlackboxTestCase(TestCaseInTempDir):
         bindir = os.path.abspath(os.path.join(os.path.dirname(__file__), "../../../../bin"))
         parts = line.split(" ")
         if os.path.exists(os.path.join(bindir, parts[0])):
+            cmd = parts[0]
             parts[0] = os.path.join(bindir, parts[0])
+            if cmd == "samba-tool" and os.getenv("PYTHON", None):
+                parts = [os.environ["PYTHON"]] + parts
         line = " ".join(parts)
         return line