Close file in read_image()
This commit is contained in:
parent
f15291031a
commit
d5fdeb80ce
@ -249,9 +249,10 @@ def generateGameData(LANG):
|
|||||||
|
|
||||||
def read_image(path:str):
|
def read_image(path:str):
|
||||||
try:
|
try:
|
||||||
return open(path, "rb").read()
|
with open(path, "rb") as f:
|
||||||
except:
|
return f.read()
|
||||||
return 1
|
except IOError:
|
||||||
|
return None
|
||||||
|
|
||||||
def get_trait_id_from_string(trait):
|
def get_trait_id_from_string(trait):
|
||||||
return get_trait_from_text(trait)
|
return get_trait_from_text(trait)
|
||||||
|
Loading…
Reference in New Issue
Block a user