mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-19 08:11:16 +00:00
validate: Properly kill subprocesses on windows
This commit is contained in:
parent
f6d0636466
commit
f24e22446b
2 changed files with 10 additions and 1 deletions
|
@ -339,7 +339,10 @@ class Test(Loggable):
|
|||
while res is None:
|
||||
try:
|
||||
self.debug("Subprocess is still alive, sending KILL signal")
|
||||
self.process.send_signal(signal.SIGKILL)
|
||||
if utils.is_windows():
|
||||
subprocess.call(['taskkill', '/F', '/T', '/PID', str(self.process.pid)])
|
||||
else:
|
||||
self.process.send_signal(signal.SIGKILL)
|
||||
time.sleep(1)
|
||||
except OSError:
|
||||
pass
|
||||
|
|
|
@ -24,6 +24,7 @@ except ImportError:
|
|||
from . import config
|
||||
|
||||
import os
|
||||
import platform
|
||||
import re
|
||||
import shutil
|
||||
import subprocess
|
||||
|
@ -159,6 +160,11 @@ def path2url(path):
|
|||
return urllib.parse.urljoin('file:', urllib.request.pathname2url(path))
|
||||
|
||||
|
||||
def is_windows():
|
||||
platname = platform.system().lower()
|
||||
return platname == 'windows' or 'mingw' in platname
|
||||
|
||||
|
||||
def url2path(url):
|
||||
path = urllib.parse.urlparse(url).path
|
||||
if "win32" in sys.platform:
|
||||
|
|
Loading…
Reference in a new issue