def _await_signal(process):
''' Waits for the process to die, and then returns the exit code for
the process, converting CTRL_C_EVENT and CTRL_BREAK_EVENT into
SIGINT.
'''
# Note that this is implemented with a busy wait
process.wait()
code = process.returncode
if code == signal.CTRL_C_EVENT:
code = signal.SIGINT
elif code == signal.CTRL_BREAK_EVENT:
code = signal.SIGINT
return code
评论列表
文章目录