def _get_new_progress_group_args():
"""
Gets a tuple containing the `preexec_fn` and `creationflags` parameters to subprocess.Popen
required to create a subprocess that can be killed via os.killpg without killing the
process group of the parent process.
"""
preexec_fn = None
creationflags = 0
if not is_jython():
if get_os() == 'windows':
creationflags = subprocess.CREATE_NEW_PROCESS_GROUP
else:
preexec_fn = os.setsid
return preexec_fn, creationflags
评论列表
文章目录