LocalRuntimeMixin.py
branchwxPython4
changeset 3566 7f5659b1eeb8
parent 3539 c2eec6aae07e
child 3714 c3a13fcbda3a
--- a/LocalRuntimeMixin.py	Wed Jul 27 21:34:23 2022 +0200
+++ b/LocalRuntimeMixin.py	Thu Jul 28 13:24:49 2022 +0200
@@ -1,5 +1,7 @@
 #!/usr/bin/env python
 # -*- coding: utf-8 -*-
+
+import os
 import sys
 import tempfile
 import random
@@ -7,6 +9,11 @@
 from util.ProcessLogger import ProcessLogger
 from util.paths import Bpath
 
+LocalRuntimeInterpreterPath = \
+    os.environ["BEREMIZPYTHONPATH"] \
+    if os.environ.has_key("BEREMIZPYTHONPATH") \
+    else sys.executable
+
 class LocalRuntimeMixin():
 
     def __init__(self, log, use_gui=True):
@@ -27,7 +34,7 @@
             self.local_runtime = ProcessLogger(
                 self.local_runtime_log,
                 "\"%s\" \"%s\" -p %s -i localhost %s %s" % (
-                    sys.executable,
+                    LocalRuntimeInterpreterPath,
                     Bpath("Beremiz_service.py"),
                     self.runtime_port,
                     {False: "-x 0", True: "-x 1"}[self.use_gui],