close open file

This commit is contained in:
cidoku 2025-03-11 04:12:22 -03:00
parent 529ba583b7
commit db6ddea0ed

10
ini.py
View File

@ -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