[tune] Close logfile contexts (#10026)

Co-authored-by: Kai Fricke <kai@anyscale.com>
This commit is contained in:
krfricke
2020-08-10 21:40:40 +02:00
committed by GitHub
parent 6ad2fc4831
commit 7301733a1f
+2
View File
@@ -625,10 +625,12 @@ class Trainable:
self._stdout_stream.flush()
self._stdout_context.__exit__(None, None, None)
self._stdout_fp.close()
self._stdout_context = None
if self._stderr_context:
self._stderr_stream.flush()
self._stderr_context.__exit__(None, None, None)
self._stderr_fp.close()
self._stderr_context = None
def stop(self):
"""Releases all resources used by this trainable.