resume.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:tensorflow-layer-library 作者: bioinf-jku 项目源码 文件源码
def sigint_handler(sig, frame):
    print("Killing sub-process...")
    if process_handle is not None:
        global kill_retry_count
        while process_handle.returncode is None and kill_retry_count < kill_retry_max:
            kill_retry_count += 1
            print("Killing sub-process ({})...".format(kill_retry_count))
            try:
                os.killpg(os.getpgid(process_handle.pid), signal.SIGTERM)
                os.waitpid(process_handle.pid, os.WNOHANG)
            except ProcessLookupError:
                break

            try:
                process_handle.wait(1)
            except subprocess.TimeoutExpired:
                pass

    if working_dir is not None:
        rmdir(working_dir)

    sys.exit(0)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号