mirror of
https://github.com/aclist/dztui.git
synced 2026-08-27 02:07:18 +02:00
chore: clean up try/except block
Some checks failed
Mirror to Codeberg / mirror-to-codeberg (push) Has been cancelled
Some checks failed
Mirror to Codeberg / mirror-to-codeberg (push) Has been cancelled
This commit is contained in:
parent
74bf4b5cfc
commit
87f347870f
@ -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
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user