From 96b867343a77509718ec848a71993b77d40cf0d4 Mon Sep 17 00:00:00 2001 From: ana Date: Mon, 23 Nov 2015 18:22:13 +0300 Subject: [PATCH] Fix for the bug 0023165: [CEA 1590] Salome 7.6.0 on Windows does not liberate the ports Additional fix to previous commit --- bin/killSalomeWithPort.py | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/bin/killSalomeWithPort.py b/bin/killSalomeWithPort.py index a1057d8ad..31eaceb1b 100755 --- a/bin/killSalomeWithPort.py +++ b/bin/killSalomeWithPort.py @@ -354,19 +354,14 @@ def cleanApplication(port): def killMyPortSpy(pid, port): dt = 1.0 while 1: - if sys.platform == "win32": - from salome_utils import win32killpid - if win32killpid(int(pid)) != 0: + try: + from salome_utils import killpid + killpid(int(pid)) + except OSError, e: + if e.errno != 3: return - else: - from os import kill - try: - kill(int(pid), 0) - except OSError, e: - if e.errno != 3: - return - break - pass + break + pass from time import sleep sleep(dt) pass -- 2.39.2