]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
bos #20365: fix salome killall & salome kill <port> under Windows rnv/20365
authorrnv <rnv@opencascade.com>
Thu, 6 May 2021 14:32:22 +0000 (17:32 +0300)
committerrnv <rnv@opencascade.com>
Thu, 6 May 2021 14:32:22 +0000 (17:32 +0300)
bin/salomeContext.py

index e7f6e2b1c1f09d3e32efdd1dd2408cf279b76257..d4d44afdd8ed3cf77c908e2eeea9f98302144f9c 100755 (executable)
@@ -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