mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-06 12:14:27 +08:00
add constructors for configparser errors (#4215)
Fixes #4058 Co-authored-by: Shantanu <hauntsaninja@users.noreply.github.com>
This commit is contained in:
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user