Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/iniconfig/exceptions.py: 87%
15 statements
« prev ^ index » next coverage.py v7.2.2, created at 2023-03-26 06:04 +0000
« prev ^ index » next coverage.py v7.2.2, created at 2023-03-26 06:04 +0000
1from __future__ import annotations
2from typing import TYPE_CHECKING
4if TYPE_CHECKING:
5 from typing_extensions import Final
8class ParseError(Exception):
9 path: Final[str]
10 lineno: Final[int]
11 msg: Final[str]
13 def __init__(self, path: str, lineno: int, msg: str) -> None:
14 super().__init__(path, lineno, msg)
15 self.path = path
16 self.lineno = lineno
17 self.msg = msg
19 def __str__(self) -> str:
20 return f"{self.path}:{self.lineno + 1}: {self.msg}"