2
0
mirror of https://gitlab.com/ita1024/waf.git synced 2024-11-25 11:19:52 +01:00

Call killpg only if setsid is enabled

This commit is contained in:
Thomas Nagy 2016-09-03 20:22:43 +02:00
parent a91e7be005
commit 71aed22539
No known key found for this signature in database
GPG Key ID: 49B4C67C05277AAA
3 changed files with 11 additions and 6 deletions

View File

@ -1,3 +1,8 @@
NEW IN WAF 1.9.4
----------------
* Enable 'waf dist' in arbitrary paths #1806
* Handle subprocess timeouts in Python 3.3 #1807
NEW IN WAF 1.9.3
----------------
* Improve the behaviour of parallel configuration tests (conf.multicheck) #1793

View File

@ -865,9 +865,9 @@ def run_regular_process(cmd, kwargs, cargs={}):
try:
out, err = proc.communicate(**cargs)
except TimeoutExpired:
try:
if kwargs.get('start_new_session') and hasattr(os, 'killpg'):
os.killpg(proc.pid, signal.SIGKILL)
except AttributeError:
else:
proc.kill()
out, err = proc.communicate()
raise TimeoutExpired(proc.args, timeout=cargs['timeout'], output=out, stderr=err)
@ -877,9 +877,9 @@ def run_regular_process(cmd, kwargs, cargs={}):
try:
status = proc.wait(**cargs)
except TimeoutExpired as e:
try:
if kwargs.get('start_new_session') and hasattr(os, 'killpg'):
os.killpg(proc.pid, signal.SIGKILL)
except AttributeError:
else:
proc.kill()
proc.wait()
raise e

View File

@ -34,9 +34,9 @@ def run():
try:
out, err = proc.communicate(**cargs)
except TimeoutExpired:
try:
if kwargs.get('start_new_session') and hasattr(os, 'killpg'):
os.killpg(proc.pid, signal.SIGKILL)
except AttributeError:
else:
proc.kill()
out, err = proc.communicate()
raise TimeoutExpired(proc.args, timeout=cargs['timeout'], output=out, stderr=err)