diff --git a/ini.py b/ini.py index 83bc288..fcb46dd 100644 --- a/ini.py +++ b/ini.py @@ -123,11 +123,11 @@ def get_effects(char): effects = ["realization", "hearts", "reaction", "impact"] if not exists(p_path): return effects - lines = open(p_path).read().split("\n") - for line in lines: - effect = line.split("=")[0].rstrip() - if effect and effect not in effects: - effects.append(effect) + with open(p_path).read().split("\n") as lines: + for line in lines: + effect = line.split("=")[0].rstrip() + if effect and effect not in effects: + effects.append(effect) return effects