close open file
This commit is contained in:
parent
529ba583b7
commit
db6ddea0ed
10
ini.py
10
ini.py
@ -123,11 +123,11 @@ def get_effects(char):
|
|||||||
effects = ["realization", "hearts", "reaction", "impact"]
|
effects = ["realization", "hearts", "reaction", "impact"]
|
||||||
if not exists(p_path): return effects
|
if not exists(p_path): return effects
|
||||||
|
|
||||||
lines = open(p_path).read().split("\n")
|
with open(p_path).read().split("\n") as lines:
|
||||||
for line in lines:
|
for line in lines:
|
||||||
effect = line.split("=")[0].rstrip()
|
effect = line.split("=")[0].rstrip()
|
||||||
if effect and effect not in effects:
|
if effect and effect not in effects:
|
||||||
effects.append(effect)
|
effects.append(effect)
|
||||||
|
|
||||||
return effects
|
return effects
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user