提交 659f6399 authored 作者: Frederic's avatar Frederic 提交者: Frederic Bastien

Small file cleanup

上级 bc2f6793
......@@ -51,8 +51,8 @@ def mysend(subject, file):
# Open the files in binary mode. Let the MIMEImage class automatically
# guess the specific image type.
fp = open(file, 'rb')
s=fp.read()
with open(file, 'rb') as fp:
s=fp.read()
failures=0
errors=0
ran=False
......@@ -115,7 +115,6 @@ def mysend(subject, file):
s = ("Summary of the output:\n\n" + filter_output(open(file)) +
"\n\nFull output:\n\n" + s)
img = MIMEText(s)
fp.close()
msg.attach(img)
# Send the email via our own SMTP server.
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论