Merge pull request #32 from ThomasRubini/read_image

This commit is contained in:
Thomas Rubini 2023-01-13 13:54:06 +01:00 committed by GitHub
commit 4f753c3c45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -249,9 +249,10 @@ def generateGameData(LANG):
def read_image(path:str):
try:
return open(path, "rb").read()
except:
return 1
with open(path, "rb") as f:
return f.read()
except IOError:
return None
def get_trait_id_from_string(trait):
return get_trait_from_text(trait)