diff options
| author | Claude <noreply@anthropic.com> | 2026-09-09 22:10:55 +0000 |
|---|---|---|
| committer | Claude <noreply@anthropic.com> | 2026-09-09 22:10:55 +0000 |
| commit | 9771d67eb06a525d9235c00108b2392ca1b92d7c (patch) | |
| tree | fb9f2cfad9395d1e4ffd0e8f6c6e10cb2b3d6110 /plugins/claude-security/scripts/lib/strictjson.py | |
| parent | 0c81ec93038e0bff9e9af08266d61102a667d19e (diff) | |
| parent | 3ea32df27be71d78775e627df2382fc26203577f (diff) | |
Merge branch 'main' into tobin/add-hubspot-salestobin/add-hubspot-sales
Diffstat (limited to 'plugins/claude-security/scripts/lib/strictjson.py')
| -rw-r--r-- | plugins/claude-security/scripts/lib/strictjson.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/claude-security/scripts/lib/strictjson.py b/plugins/claude-security/scripts/lib/strictjson.py index 2c5a9900..91d4ee30 100644 --- a/plugins/claude-security/scripts/lib/strictjson.py +++ b/plugins/claude-security/scripts/lib/strictjson.py @@ -16,7 +16,7 @@ from collections.abc import Mapping from typing import TYPE_CHECKING, NoReturn, cast if TYPE_CHECKING: - import os + from pathlib import Path from typing import TypeGuard JsonMap = Mapping[str, object] @@ -65,9 +65,9 @@ def _finite(digits: str) -> float: return value -def load(path: str | os.PathLike[str]) -> object: +def load(path: Path) -> object: """The JSON value in `path`; OSError if unreadable, ValueError if not strict JSON.""" - with open(path, encoding="utf-8") as handle: + with path.open(encoding="utf-8") as handle: try: return cast("object", json.load(handle, parse_constant=_refuse, parse_float=_finite)) except RecursionError as error: |
