mirror of
https://github.com/aclist/dztui.git
synced 2026-10-25 12:12:31 +01:00
This commit is contained in:
1 parent
74bf4b5cfc
commit
87f347870f
1 file changed
+4
-6
+4
-6
@@ -2,15 +2,13 @@ import json
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
|
||||
def read_json(path: Path) -> Any:
|
||||
try:
|
||||
with open(path, "r") as infile:
|
||||
try:
|
||||
data = json.load(infile)
|
||||
return data
|
||||
except json.decoder.JSONDecodeError as e:
|
||||
raise e
|
||||
except OSError as e:
|
||||
data = json.load(infile)
|
||||
return data
|
||||
except Exception as e:
|
||||
raise e
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user