1
Fork 0
mirror of https://github.com/RGBCube/JsonWrapper synced 2025-07-27 11:47:45 +00:00

Update json_wrapper.py

This commit is contained in:
RGBCube 2022-01-27 18:59:45 +03:00 committed by GitHub
parent ca019736eb
commit 9cee07f702
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -33,7 +33,7 @@ class _JsonUtils:
with open(self.json_path, mode="r") as json_file: with open(self.json_path, mode="r") as json_file:
data = json.load(json_file) data = json.load(json_file)
except (FileNotFoundError, ValueError): except (FileNotFoundError, JSONDecodeError):
with open(self.json_path, mode="w") as json_file: with open(self.json_path, mode="w") as json_file:
json.dump({}, json_file) json.dump({}, json_file)
return return