chore: clean up try/except block
Some checks failed
Mirror to Codeberg / mirror-to-codeberg (push) Has been cancelled

This commit is contained in:
aclist 2026-05-19 23:41:51 +09:00
parent 74bf4b5cfc
commit 87f347870f

View File

@ -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