Clean code, fd.close not required since open as fd if used; remove get_redirected_output from cleanup_redirection_tempfiles since output is not used

(cherry picked from commit ef51f00bbc9f24485915040b863c9d034d3c272c)
This commit is contained in:
Sebastien Boyron 2017-09-21 14:42:40 +02:00 committed by Toshio Kuratomi
parent f66c74915c
commit 901bc2cffe

View file

@ -511,8 +511,8 @@ def make_redirection_tempfiles():
def cleanup_redirection_tempfiles(out_name, err_name):
get_redirected_output(out_name)
get_redirected_output(err_name)
for i in [out_name, err_name]:
os.remove(i)
def get_redirected_output(path_name):
@ -522,7 +522,6 @@ def get_redirected_output(path_name):
# strip terminal format/color chars
new_line = re.sub(r'\x1b\[.+m', '', line)
output.append(new_line)
fd.close()
os.remove(path_name)
return output