diff --git a/fofix/game/Credits.py b/fofix/game/Credits.py index 001e35b22..d0dd4acb3 100644 --- a/fofix/game/Credits.py +++ b/fofix/game/Credits.py @@ -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