MCPcopy Index your code
hub / github.com/python-jsonschema/jsonschema / load

Method load

jsonschema/cli.py:50–62  ·  view source on GitHub ↗
(self, path)

Source from the content-addressed store, hash-verified

48 return cls(formatter=formatter, stdout=stdout, stderr=stderr)
49
50 def load(self, path):
51 try:
52 file = open(path) # noqa: SIM115, PTH123
53 except FileNotFoundError as error:
54 self.filenotfound_error(path=path, exc_info=sys.exc_info())
55 raise _CannotLoadFile() from error
56
57 with file:
58 try:
59 return json.load(file)
60 except JSONDecodeError as error:
61 self.parsing_error(path=path, exc_info=sys.exc_info())
62 raise _CannotLoadFile() from error
63
64 def filenotfound_error(self, **kwargs):
65 self._stderr.write(self._formatter.filenotfound_error(**kwargs))

Callers 3

runFunction · 0.80
loadFunction · 0.80

Calls 4

filenotfound_errorMethod · 0.95
parsing_errorMethod · 0.95
openFunction · 0.85
_CannotLoadFileClass · 0.85

Tested by

no test coverage detected