Skip to content

Commit

Permalink
Ensure report is always written out and then cleared.
Browse files Browse the repository at this point in the history
  • Loading branch information
shweppsie committed Mar 3, 2011
1 parent bcbf38f commit 0effbbe
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/renamealbum/util.py
Expand Up @@ -101,10 +101,12 @@ def report(message):

def write_report(reportpath):
global report_entries
f = open(reportpath, "w")
for r in report_entries:
f.write(r.encode("utf8"))
f.write("\n")
report_entries = []
f.close()
f = open(reportpath, "w")
try:
for r in report_entries:
f.write(r.encode("utf8"))
f.write("\n")
finally:
f.close()
report_entries = []

0 comments on commit 0effbbe

Please sign in to comment.