def __exit__(self, exc_type, exc_val, exc_tb):
"""
Stop the process and then do cleanup.
:param exc_type: Exception type
:param exc_val: Exception value
:param exc_tb: Exception traceback information
"""
self.stop()
# "...on exit, standard file descriptors are closed, and the process is waited for."
# `subprocess — Subprocess management <https://docs.python.org/3/library/subprocess.html#subprocess.Popen>`_
super().__exit__(exc_type, exc_val, exc_tb)
self.update()
# close files used for feedback
self.cleanup()
评论列表
文章目录