Skip to content

Commit

Permalink
Read the CREDITS file with the with statement
Browse files Browse the repository at this point in the history
  • Loading branch information
Linkid committed Nov 14, 2017
1 parent 1c562be commit d1457b9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions fofix/game/Credits.py
Expand Up @@ -253,8 +253,10 @@ def parseFile(self, filename):
self.credits.append(Text(nf, bs * scale, c1, "left", "%s" % err))
return

file = open(path)
for line in file:
with open(path) as f:
filelines = f.readlines()

for line in filelines:
line = line.strip("\n")
if line.startswith("=====") or line.startswith("-----"):
continue
Expand Down

0 comments on commit d1457b9

Please sign in to comment.