Bug 475455 - [Windows 2000] runtests.py: automation.py can't kill ssltunnel.exe; (Av1b) Support Win2K kill.exe tool; r=jwalden+bmo

This commit is contained in:
Serge Gautherie 2009-01-29 14:37:37 +01:00
Родитель 7bd5473b8d
Коммит 06f1824fb1
1 изменённых файлов: 10 добавлений и 1 удалений

Просмотреть файл

@ -113,8 +113,17 @@ class Process(subprocess.Popen):
def kill(self):
if IS_WIN32:
import platform
pid = "%i" % self.pid
subprocess.Popen(["taskkill", "/F", "/PID", pid]).wait()
if platform.release() == "2000":
# Windows 2000 needs 'kill.exe' from the 'Windows 2000 Resource Kit tools'. (See bug 475455.)
try:
subprocess.Popen(["kill", "-f", pid]).wait()
except:
log.info("ERROR FAIL Missing 'kill' utility to kill process with pid=%s. Kill it manually !", pid)
else:
# Windows XP and later.
subprocess.Popen(["taskkill", "/F", "/PID", pid]).wait()
else:
os.kill(self.pid, signal.SIGKILL)