From: rnv Date: Thu, 6 May 2021 14:32:22 +0000 (+0300) Subject: bos #20365: fix salome killall & salome kill under Windows X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Frnv%2F20365;p=modules%2Fkernel.git bos #20365: fix salome killall & salome kill under Windows --- diff --git a/bin/salomeContext.py b/bin/salomeContext.py index e7f6e2b1c..d4d44afdd 100755 --- a/bin/salomeContext.py +++ b/bin/salomeContext.py @@ -435,7 +435,10 @@ class SalomeContext: if os.getenv("NSHOST") == "no_host": os.unsetenv("NSHOST") for port in ports: - proc = subprocess.Popen(["killSalomeWithPort.py", port]) + if sys.platform == "win32": + proc = subprocess.Popen([os.getenv("PYTHONBIN"), "-m", "killSalomeWithPort", str(port)]) + else: + proc = subprocess.Popen(["killSalomeWithPort.py", str(port)]) proc.communicate() return 0 @@ -454,7 +457,10 @@ class SalomeContext: if ports: for port in ports: - proc = subprocess.Popen(["killSalomeWithPort.py", str(port)]) + if sys.platform == "win32": + proc = subprocess.Popen([os.getenv("PYTHONBIN"), "-m", "killSalomeWithPort", str(port)]) + else: + proc = subprocess.Popen(["killSalomeWithPort.py", str(port)]) proc.communicate() except ImportError: # :TODO: should be declared obsolete