未验证 提交 82c6434d 编写于 作者: L Lin Manhui 提交者: GitHub

Fix attribute error on win (#10209)

上级 45848fda
......@@ -53,7 +53,13 @@ def term_mp(sig_num, frame):
def set_signal_handlers():
pid = os.getpid()
pgid = os.getpgid(os.getpid())
try:
pgid = os.getpgid(pid)
except AttributeError:
# In case `os.getpgid` is not available, no signal handler will be set,
# because we cannot do safe cleanup.
pass
else:
# XXX: `term_mp` kills all processes in the process group, which in
# some cases includes the parent process of current process and may
# cause unexpected results. To solve this problem, we set signal
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册