Skip to content

Commit

Permalink
Update cli.py (#178)
Browse files Browse the repository at this point in the history
refactor with With statement to open file to make code more Pythonic
  • Loading branch information
anonymousdouble authored Dec 19, 2023
1 parent 3a5df1b commit 951790d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions slackviewer/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@ def export(archive_dir):
source_file=export_file_info["basename"],
channels=channel_list
)
outfile = open(export_file_info["stripped_name"] + '.html', 'w')
outfile.write(html.encode('utf-8'))
with open(export_file_info['stripped_name'] + '.html', 'w') as outfile:
outfile.write(html.encode('utf-8'))

0 comments on commit 951790d

Please sign in to comment.