From db6ddea0ed0fe6147dc737f1579f3791b6fd5331 Mon Sep 17 00:00:00 2001 From: cidoku Date: Tue, 11 Mar 2025 04:12:22 -0300 Subject: [PATCH] close open file --- ini.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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