flush the file every line

This commit is contained in:
JerryXiao 2019-04-09 23:02:48 +08:00
parent cbec64fb3c
commit 84f8afd8a0
Signed by: Jerry
GPG Key ID: 9D9CE43650FF2BAA
1 changed files with 1 additions and 0 deletions

View File

@ -79,6 +79,7 @@ def run_cmd(cmd, cwd=None, keepalive=False, KEEPALIVE_TIMEOUT=30, RUN_CMD_TIMEOU
super().append(mystring)
if self.__file and type(mystring) is str:
self.__file.write(mystring)
self.__file.flush()
def __enter__(self):
return self
def __exit__(self, type, value, traceback):