Commit a797c9be authored by Jason R. Coombs's avatar Jason R. Coombs

Use context for closing file

parent 6e248ac4
......@@ -102,9 +102,8 @@ class upload_docs(upload):
shutil.rmtree(tmp_dir)
def upload_file(self, filename):
f = open(filename, 'rb')
content = f.read()
f.close()
with open(filename, 'rb') as f:
content = f.read()
meta = self.distribution.metadata
data = {
':action': 'doc_upload',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment