add constructors for configparser errors (#4215)

Fixes #4058

Co-authored-by: Shantanu <hauntsaninja@users.noreply.github.com>
This commit is contained in:
Jelle Zijlstra
2020-06-10 12:32:18 -07:00
committed by GitHub
parent ea577cec1f
commit d261f14886

View File

@@ -190,16 +190,21 @@ class ConverterMapping(MutableMapping[str, Optional[_converter]]):
def __len__(self) -> int: ...
class Error(Exception): ...
class Error(Exception):
message: str
def __init__(self, msg: str = ...) -> None: ...
class NoSectionError(Error): ...
class NoSectionError(Error):
section: str
def __init__(self, section: str) -> None: ...
class DuplicateSectionError(Error):
section: str
source: Optional[str]
lineno: Optional[int]
def __init__(self, section: str, source: Optional[str] = ..., lineno: Optional[int] = ...) -> None: ...
class DuplicateOptionError(Error):
@@ -207,23 +212,28 @@ class DuplicateOptionError(Error):
option: str
source: Optional[str]
lineno: Optional[int]
def __init__(self, section: str, option: str, source: Optional[str] = ..., lineno: Optional[str] = ...) -> None: ...
class NoOptionError(Error):
section: str
option: str
def __init__(self, option: str, section: str) -> None: ...
class InterpolationError(Error):
section: str
option: str
def __init__(self, option: str, section: str, msg: str) -> None: ...
class InterpolationDepthError(InterpolationError): ...
class InterpolationDepthError(InterpolationError):
def __init__(self, option: str, section: str, rawval: object) -> None: ...
class InterpolationMissingOptionError(InterpolationError):
reference: str
def __init__(self, option: str, section: str, rawval: object, reference: str) -> None: ...
class InterpolationSyntaxError(InterpolationError): ...
@@ -231,9 +241,12 @@ class InterpolationSyntaxError(InterpolationError): ...
class ParsingError(Error):
source: str
errors: Sequence[Tuple[int, str]]
errors: List[Tuple[int, str]]
def __init__(self, source: Optional[str] = ..., filename: Optional[str] = ...) -> None: ...
def append(self, lineno: int, line: str) -> None: ...
class MissingSectionHeaderError(ParsingError):
lineno: int
line: str
def __init__(self, filename: str, lineno: int, line: str) -> None: ...