Skip to content

Commit ece9677

Browse files
srittauJelleZijlstra
authored andcommitted
Re-export pyexpat instead of using check_consistency (python#2649)
1 parent 98e63d2 commit ece9677

File tree

4 files changed

+3
-133
lines changed

4 files changed

+3
-133
lines changed
Lines changed: 1 addition & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1 @@
1-
from typing import List, Tuple, Optional, Callable, Any, Protocol, Union, Dict, Text
2-
3-
import pyexpat.errors as errors
4-
import pyexpat.model as model
5-
6-
EXPAT_VERSION: str # undocumented
7-
version_info: Tuple[int, int, int] # undocumented
8-
native_encoding: str # undocumented
9-
features: List[Tuple[str, int]] # undocumented
10-
11-
class ExpatError(Exception):
12-
code: int
13-
lineno: int
14-
offset: int
15-
16-
error = ExpatError
17-
18-
class _Reader(Protocol):
19-
def read(self, length: int) -> bytes: ...
20-
21-
XML_PARAM_ENTITY_PARSING_NEVER: int
22-
XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE: int
23-
XML_PARAM_ENTITY_PARSING_ALWAYS: int
24-
25-
_Model = Tuple[int, int, Optional[str], tuple]
26-
27-
class XMLParserType(object):
28-
def Parse(self, data: Union[Text, bytes], isfinal: bool = ...) -> int: ...
29-
def ParseFile(self, file: _Reader) -> int: ...
30-
def SetBase(self, base: Text) -> None: ...
31-
def GetBase(self) -> Optional[str]: ...
32-
def GetInputContext(self) -> Optional[bytes]: ...
33-
def ExternalEntityParserCreate(self, context: Optional[Text], encoding: Text = ...) -> XMLParserType: ...
34-
def SetParamEntityParsing(self, flag: int) -> int: ...
35-
def UseForeignDTD(self, flag: bool = ...) -> None: ...
36-
buffer_size: int
37-
buffer_text: bool
38-
buffer_used: int
39-
namespace_prefixes: bool # undocumented
40-
ordered_attributes: bool
41-
specified_attributes: bool
42-
ErrorByteIndex: int
43-
ErrorCode: int
44-
ErrorColumnNumber: int
45-
ErrorLineNumber: int
46-
CurrentByteIndex: int
47-
CurrentColumnNumber: int
48-
CurrentLineNumber: int
49-
XmlDeclHandler: Optional[Callable[[str, Optional[str], int], Any]]
50-
StartDoctypeDeclHandler: Optional[Callable[[str, Optional[str], Optional[str], bool], Any]]
51-
EndDoctypeDeclHandler: Optional[Callable[[], Any]]
52-
ElementDeclHandler: Optional[Callable[[str, _Model], Any]]
53-
AttlistDeclHandler: Optional[Callable[[str, str, str, Optional[str], bool], Any]]
54-
StartElementHandler: Optional[Union[
55-
Callable[[str, Dict[str, str]], Any],
56-
Callable[[str, List[str]], Any],
57-
Callable[[str, Union[Dict[str, str]], List[str]], Any]]]
58-
EndElementHandler: Optional[Callable[[str], Any]]
59-
ProcessingInstructionHandler: Optional[Callable[[str, str], Any]]
60-
CharacterDataHandler: Optional[Callable[[str], Any]]
61-
UnparsedEntityDeclHandler: Optional[Callable[[str, Optional[str], str, Optional[str], str], Any]]
62-
EntityDeclHandler: Optional[Callable[[str, bool, Optional[str], Optional[str], str, Optional[str], Optional[str]], Any]]
63-
NotationDeclHandler: Optional[Callable[[str, Optional[str], str, Optional[str]], Any]]
64-
StartNamespaceDeclHandler: Optional[Callable[[str, str], Any]]
65-
EndNamespaceDeclHandler: Optional[Callable[[str], Any]]
66-
CommentHandler: Optional[Callable[[str], Any]]
67-
StartCdataSectionHandler: Optional[Callable[[], Any]]
68-
EndCdataSectionHandler: Optional[Callable[[], Any]]
69-
DefaultHandler: Optional[Callable[[str], Any]]
70-
DefaultHandlerExpand: Optional[Callable[[str], Any]]
71-
NotStandaloneHandler: Optional[Callable[[], int]]
72-
ExternalEntityRefHandler: Optional[Callable[[str, Optional[str], Optional[str], Optional[str]], int]]
73-
74-
def ErrorString(errno: int) -> str: ...
75-
def ParserCreate(encoding: Optional[Text] = ..., namespace_separator: Optional[Text] = ...) -> XMLParserType: ...
1+
from pyexpat import *
Lines changed: 1 addition & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1 @@
1-
import sys
2-
from typing import Dict
3-
4-
if sys.version_info >= (3, 2):
5-
codes: Dict[str, int]
6-
messages: Dict[int, str]
7-
8-
XML_ERROR_ABORTED: str
9-
XML_ERROR_ASYNC_ENTITY: str
10-
XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF: str
11-
XML_ERROR_BAD_CHAR_REF: str
12-
XML_ERROR_BINARY_ENTITY_REF: str
13-
XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING: str
14-
XML_ERROR_DUPLICATE_ATTRIBUTE: str
15-
XML_ERROR_ENTITY_DECLARED_IN_PE: str
16-
XML_ERROR_EXTERNAL_ENTITY_HANDLING: str
17-
XML_ERROR_FEATURE_REQUIRES_XML_DTD: str
18-
XML_ERROR_FINISHED: str
19-
XML_ERROR_INCOMPLETE_PE: str
20-
XML_ERROR_INCORRECT_ENCODING: str
21-
XML_ERROR_INVALID_TOKEN: str
22-
XML_ERROR_JUNK_AFTER_DOC_ELEMENT: str
23-
XML_ERROR_MISPLACED_XML_PI: str
24-
XML_ERROR_NOT_STANDALONE: str
25-
XML_ERROR_NOT_SUSPENDED: str
26-
XML_ERROR_NO_ELEMENTS: str
27-
XML_ERROR_NO_MEMORY: str
28-
XML_ERROR_PARAM_ENTITY_REF: str
29-
XML_ERROR_PARTIAL_CHAR: str
30-
XML_ERROR_PUBLICID: str
31-
XML_ERROR_RECURSIVE_ENTITY_REF: str
32-
XML_ERROR_SUSPENDED: str
33-
XML_ERROR_SUSPEND_PE: str
34-
XML_ERROR_SYNTAX: str
35-
XML_ERROR_TAG_MISMATCH: str
36-
XML_ERROR_TEXT_DECL: str
37-
XML_ERROR_UNBOUND_PREFIX: str
38-
XML_ERROR_UNCLOSED_CDATA_SECTION: str
39-
XML_ERROR_UNCLOSED_TOKEN: str
40-
XML_ERROR_UNDECLARING_PREFIX: str
41-
XML_ERROR_UNDEFINED_ENTITY: str
42-
XML_ERROR_UNEXPECTED_STATE: str
43-
XML_ERROR_UNKNOWN_ENCODING: str
44-
XML_ERROR_XML_DECL: str
1+
from pyexpat.errors import *
Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1 @@
1-
XML_CTYPE_ANY: int
2-
XML_CTYPE_CHOICE: int
3-
XML_CTYPE_EMPTY: int
4-
XML_CTYPE_MIXED: int
5-
XML_CTYPE_NAME: int
6-
XML_CTYPE_SEQ: int
7-
8-
XML_CQUANT_NONE: int
9-
XML_CQUANT_OPT: int
10-
XML_CQUANT_PLUS: int
11-
XML_CQUANT_REP: int
1+
from pyexpat.model import *

tests/check_consistent.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010
{'stdlib/2/builtins.pyi', 'stdlib/2/__builtin__.pyi'},
1111
{'stdlib/2/SocketServer.pyi', 'stdlib/3/socketserver.pyi'},
1212
{'stdlib/2/os2emxpath.pyi', 'stdlib/2/posixpath.pyi', 'stdlib/2/ntpath.pyi', 'stdlib/2/macpath.pyi'},
13-
{'stdlib/2and3/pyexpat/__init__.pyi', 'stdlib/2and3/xml/parsers/expat/__init__.pyi'},
14-
{'stdlib/2and3/pyexpat/errors.pyi', 'stdlib/2and3/xml/parsers/expat/errors.pyi'},
15-
{'stdlib/2and3/pyexpat/model.pyi', 'stdlib/2and3/xml/parsers/expat/model.pyi'},
1613
{'stdlib/3/ntpath.pyi', 'stdlib/3/posixpath.pyi', 'stdlib/3/macpath.pyi', 'stdlib/3/posixpath.pyi'},
1714
{'stdlib/3/enum.pyi', 'third_party/2/enum.pyi'},
1815
{'stdlib/2/os/path.pyi', 'stdlib/3/os/path.pyi'},

0 commit comments

Comments
 (0)