configure.py 文件源码

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

项目:anonymine 作者: oskar-skog 项目源码 文件源码
def myexit(code):
    '''
    Substitute for sys.exit.  MUST be used at EOF.

    This wrapper flushes output and calls `os._exit`.

    Python 2.7.10 on NetBSD 6.1 x86-32 has a bug that causes the
    interpreter to hang after the program has finished if it has ever
    called `subprocess.Popen`.  All of `exit`, `sys.exit`, `quit` and
    end of file are affected.

    Using `os._exit` won't work either because output is buffered and
    not flushed on exit.

    https://github.com/oskar-skog/anonymine/issues/7
    http://bugs.python.org/issue28807
    http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=51657
    '''
    sys.stdout.flush()
    sys.stderr.flush()
    os._exit(code)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号