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

Small file cleanup

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