Open file via with statement so it gets closed automatically.

This commit is contained in:
Jochen Kupperschmidt
2016-06-05 22:24:48 +02:00
parent be6bd58080
commit e1b2657ff0

View File

@ -303,9 +303,8 @@ def fake_it(image, start_date, username, repo, offset=0, multiplier=1,
def save(output, filename):
"""Saves the list to a given filename"""
f = open(filename, "w")
with open(filename, "w") as f:
f.write(output)
f.close()
def main():