Skip to content

Commit

Permalink
Merge pull request #49 from julianwachholz/fix/filehandle
Browse files Browse the repository at this point in the history
Make sure to close file handle when saving workbook
  • Loading branch information
kevmo314 authored Jul 18, 2016
2 parents acf5d5b + 75eaeff commit 9392592
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 9392592

Please sign in to comment.