mirror of
https://github.com/aclist/dztui.git
synced 2026-10-31 15:12:48 +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 pathlib import Path
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
|
|
||||||
def read_json(path: Path) -> Any:
|
def read_json(path: Path) -> Any:
|
||||||
try:
|
try:
|
||||||
with open(path, "r") as infile:
|
with open(path, "r") as infile:
|
||||||
try:
|
data = json.load(infile)
|
||||||
data = json.load(infile)
|
return data
|
||||||
return data
|
except Exception as e:
|
||||||
except json.decoder.JSONDecodeError as e:
|
|
||||||
raise e
|
|
||||||
except OSError as e:
|
|
||||||
raise e
|
raise e
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user