From e7dcc3d212eca94d25a16cb6641ced6c6d1ecb77 Mon Sep 17 00:00:00 2001 From: rnv Date: Thu, 6 May 2021 17:32:22 +0300 Subject: [PATCH] bos #20365: fix salome killall & salome kill under Windows --- bin/salomeContext.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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 -- 2.39.2