Skip to content

Commit

Permalink
Make sure to close file handle when saving workbook
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian Wachholz committed Jul 18, 2016
1 parent acf5d5b commit 75eaeff
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pyexcelerate/Workbook.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,5 @@ def _save(self, file_handle):
self._writer.save(file_handle)

def save(self, filename):
self._save(open(filename, 'wb'))
with open(filename, 'wb') as fp:
self._save(fp)

0 comments on commit 75eaeff

Please sign in to comment.