MCPcopy Index your code
hub / github.com/python/cpython / ClinicError

Class ClinicError

Tools/clinic/libclinic/errors.py:6–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4
5@dc.dataclass
6class ClinicError(Exception):
7 message: str
8 _: dc.KW_ONLY
9 lineno: int | None = None
10 filename: str | None = None
11
12 def __post_init__(self) -> None:
13 super().__init__(self.message)
14
15 def report(self, *, warn_only: bool = False) -> str:
16 msg = "Warning" if warn_only else "Error"
17 if self.filename is not None:
18 msg += f" in file {self.filename!r}"
19 if self.lineno is not None:
20 msg += f" on line {self.lineno}"
21 msg += ":\n"
22 msg += f"{self.message}\n"
23 return msg
24
25
26class ParseError(ClinicError):

Callers 4

parse_fileFunction · 0.90
linear_formatFunction · 0.90
warn_or_failFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…