From ca019736eb26cf901030f6a59afeb19faa8c49a9 Mon Sep 17 00:00:00 2001 From: RGBCube <78925721+RGBCube@users.noreply.github.com> Date: Thu, 27 Jan 2022 18:55:52 +0300 Subject: [PATCH] fix --- json_wrapper.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/json_wrapper.py b/json_wrapper.py index 9bf3eb6..8163312 100644 --- a/json_wrapper.py +++ b/json_wrapper.py @@ -33,9 +33,10 @@ class _JsonUtils: with open(self.json_path, mode="r") as json_file: data = json.load(json_file) - except ValueError: + except (FileNotFoundError, ValueError): with open(self.json_path, mode="w") as json_file: json.dump({}, json_file) + return if not isinstance(data, dict): print("test")