[V3 JSON Driver] Don't save json if it exists (#1133)

This commit is contained in:
Tobotimus 2017-12-04 13:54:24 +11:00 committed by palmtree5
parent 5ebde77747
commit 9b1018fa96

View File

@ -32,14 +32,14 @@ class JSON(BaseDriver):
self.data_path.mkdir(parents=True, exist_ok=True)
self.data_path = self.data_path / self.file_name
self.jsonIO = JsonIO(self.data_path)
try:
self.data = self.jsonIO._load_json()
except FileNotFoundError:
self.data = {}
self.jsonIO._save_json(self.data)
self.jsonIO._save_json(self.data)
def get_driver(self):
return self