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)
评论列表
文章目录