moved mdfile.close()

This commit is contained in:
Dmytro Yeroshkin 2021-10-22 15:37:18 +02:00
parent e3a47d7425
commit 93340fb3f4
1 changed files with 2 additions and 2 deletions

View File

@ -78,6 +78,8 @@ def main():
word_count_by_status[current_status] += line_word_count
status_by_chapter[chapter_heading][current_status] += line_word_count
mdfile.close()
# Do some final accounting after the last chapter.
word_count_by_act[act_heading] += word_count_by_chapter[chapter_heading]
total_word_count += word_count_by_chapter[chapter_heading]
@ -114,8 +116,6 @@ def main():
print(f'{status}: {status_word_count:,} words (~{status_word_count * 100 // total_word_count}%)')
print(f'total: {total_word_count:,} words')
mdfile.close()
if __name__ == '__main__':