mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 21:46:42 +08:00
add xml.sax._exceptions module (#11147)
This commit is contained in:
@@ -1,10 +1,17 @@
|
||||
import sys
|
||||
from _typeshed import ReadableBuffer, StrPath, SupportsRead, _T_co
|
||||
from collections.abc import Iterable
|
||||
from typing import Any, NoReturn, Protocol
|
||||
from typing import Protocol
|
||||
from typing_extensions import TypeAlias
|
||||
from xml.sax._exceptions import (
|
||||
SAXException as SAXException,
|
||||
SAXNotRecognizedException as SAXNotRecognizedException,
|
||||
SAXNotSupportedException as SAXNotSupportedException,
|
||||
SAXParseException as SAXParseException,
|
||||
SAXReaderNotAvailable as SAXReaderNotAvailable,
|
||||
)
|
||||
from xml.sax.handler import ContentHandler as ContentHandler, ErrorHandler as ErrorHandler
|
||||
from xml.sax.xmlreader import Locator, XMLReader
|
||||
from xml.sax.xmlreader import XMLReader
|
||||
|
||||
class _SupportsReadClose(SupportsRead[_T_co], Protocol[_T_co]):
|
||||
def close(self) -> None: ...
|
||||
@@ -14,23 +21,6 @@ if sys.version_info >= (3, 8):
|
||||
else:
|
||||
_Source: TypeAlias = str | _SupportsReadClose[bytes] | _SupportsReadClose[str]
|
||||
|
||||
class SAXException(Exception):
|
||||
def __init__(self, msg: str, exception: Exception | None = None) -> None: ...
|
||||
def getMessage(self) -> str: ...
|
||||
def getException(self) -> Exception: ...
|
||||
def __getitem__(self, ix: Any) -> NoReturn: ...
|
||||
|
||||
class SAXParseException(SAXException):
|
||||
def __init__(self, msg: str, exception: Exception | None, locator: Locator) -> None: ...
|
||||
def getColumnNumber(self) -> int: ...
|
||||
def getLineNumber(self) -> int: ...
|
||||
def getPublicId(self): ...
|
||||
def getSystemId(self): ...
|
||||
|
||||
class SAXNotRecognizedException(SAXException): ...
|
||||
class SAXNotSupportedException(SAXException): ...
|
||||
class SAXReaderNotAvailable(SAXNotSupportedException): ...
|
||||
|
||||
default_parser_list: list[str]
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
|
||||
19
stdlib/xml/sax/_exceptions.pyi
Normal file
19
stdlib/xml/sax/_exceptions.pyi
Normal file
@@ -0,0 +1,19 @@
|
||||
from typing import NoReturn
|
||||
from xml.sax.xmlreader import Locator
|
||||
|
||||
class SAXException(Exception):
|
||||
def __init__(self, msg: str, exception: Exception | None = None) -> None: ...
|
||||
def getMessage(self) -> str: ...
|
||||
def getException(self) -> Exception: ...
|
||||
def __getitem__(self, ix: object) -> NoReturn: ...
|
||||
|
||||
class SAXParseException(SAXException):
|
||||
def __init__(self, msg: str, exception: Exception | None, locator: Locator) -> None: ...
|
||||
def getColumnNumber(self) -> int: ...
|
||||
def getLineNumber(self) -> int: ...
|
||||
def getPublicId(self): ...
|
||||
def getSystemId(self): ...
|
||||
|
||||
class SAXNotRecognizedException(SAXException): ...
|
||||
class SAXNotSupportedException(SAXException): ...
|
||||
class SAXReaderNotAvailable(SAXNotSupportedException): ...
|
||||
Reference in New Issue
Block a user