Salome HOME
Win32: remove obsolete win32pm implementation
[modules/kernel.git] / bin / killSalomeWithPort.py
index d973eae0079ba35deaf3f227d6e397cb2862a884..95497f0dbefe80091c4591fdd648211e5516122e 100755 (executable)
@@ -248,12 +248,11 @@ def __killMyPort(port, filedict):
                 for l in lines:
                     try:
                         pidfield = l.split()[0] # pid should be at the first position
+                        if verbose(): print 'stop process '+pidfield+' : omniNames'
                         if sys.platform == "win32":
-                            import win32pm #@UnresolvedImport
-                            if verbose(): print 'stop process '+pidfield+' : omniNames'
-                            win32pm.killpid(int(pidfield),0)
+                            from salome_utils import win32killpid
+                            win32killpid(int(pidfield))
                         else:
-                            if verbose(): print 'stop process '+pidfield+' : omniNames'
                             os.kill(int(pidfield),signal.SIGKILL)
                             pass
                         pass
@@ -296,8 +295,8 @@ def __killMyPort(port, filedict):
 
                         try:
                             if sys.platform == "win32":
-                                import win32pm #@UnresolvedImport @Reimport
-                                win32pm.killpid(int(pid),0)
+                                from salome_utils import win32killpid
+                                win32killpid(int(pid))
                             else:
                                 os.kill(int(pid),signal.SIGKILL)
                                 pass
@@ -433,8 +432,8 @@ def killMyPortSpy(pid, port):
     dt = 1.0
     while 1:
         if sys.platform == "win32":
-            from win32pm import killpid #@UnresolvedImport
-            if killpid(int(pid), 0) != 0:
+            from salome_utils import win32killpid
+            if win32killpid(int(pid)) != 0:
                 return
         else:
             from os import kill