Conceal Python 2.6 subprocess errors

This commit is contained in:
Thomas Nagy 2016-12-08 22:43:58 +01:00
parent de7e8b758e
commit ade48ed52e
No known key found for this signature in database
GPG Key ID: 49B4C67C05277AAA
1 changed files with 12 additions and 1 deletions

View File

@ -9,7 +9,7 @@ The portability fixes try to provide a consistent behavior of the Waf API
through Python versions 2.5 to 3.X and across different platforms (win32, linux, etc)
"""
import os, sys, errno, traceback, inspect, re, datetime, platform, base64, signal, functools
import atexit, os, sys, errno, traceback, inspect, re, datetime, platform, base64, signal, functools
try:
import cPickle
@ -972,6 +972,17 @@ def alloc_process_pool(n, force=False):
for x in lst:
process_pool.append(x)
def atexit_pool():
for k in process_pool:
try:
os.kill(k.pid, 9)
except OSError:
pass
else:
k.wait()
if sys.hexversion<0x207000f and not is_win32:
atexit.register(atexit_pool)
if sys.platform == 'cli' or not sys.executable:
run_process = run_regular_process
get_process = alloc_process_pool = nada