def terminate(self):
"""Terminate the child process. This also closes all the file
descriptors."""
if self.child_handle is None or self.terminated:
return
try:
TerminateProcess(self.child_handle, 1)
except WindowsError, e:
# ERROR_ACCESS_DENIED (also) happens when the child has already
# exited.
if e.winerror == ERROR_ACCESS_DENIED and not self.isalive():
pass
else:
raise
self.close()
self.wait()
self.terminated = True
评论列表
文章目录