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)
pull/30758/head
Sebastien Boyron 7 years ago committed by Toshio Kuratomi
parent f66c74915c
commit 901bc2cffe

@ -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

Loading…
Cancel
Save