correction bug si fichier jsin n'existe pas

This commit is contained in:
vincent 2018-01-31 22:26:34 +01:00
parent bd9a8b36bb
commit 32e7c44115

View File

@ -67,6 +67,11 @@ class Interface:
def load_jsonfile(file): def load_jsonfile(file):
try:
with open(file, 'r', encoding='utf-8') as f:
return json.load(f)
except FileNotFoundError:
parsechaine(file)
with open(file, 'r', encoding='utf-8') as f: with open(file, 'r', encoding='utf-8') as f:
return json.load(f) return json.load(f)