Skip to content

Commit 560f6dd

Browse files
authored
[html.parser] Fix stubtest for later patch releases (#14861)
1 parent 3341428 commit 560f6dd

File tree

9 files changed

+68
-9
lines changed

9 files changed

+68
-9
lines changed

stdlib/@tests/stubtest_allowlists/darwin-py310.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# =======
2+
# <= 3.12
3+
# =======
4+
5+
# Added in Python 3.10.18 (parameter `escapable`)
6+
html.parser.HTMLParser.set_cdata_mode
7+
8+
19
# =======
210
# <= 3.11
311
# =======

stdlib/@tests/stubtest_allowlists/darwin-py311.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ fcntl.F_OFD_SETLK
88
fcntl.F_OFD_SETLKW
99

1010

11+
# =======
12+
# <= 3.12
13+
# =======
14+
15+
# Added in Python 3.11.13 (parameter `escapable`)
16+
html.parser.HTMLParser.set_cdata_mode
17+
18+
1119
# =======
1220
# <= 3.11
1321
# =======

stdlib/@tests/stubtest_allowlists/darwin-py312.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ fcntl.F_OFD_SETLK
88
fcntl.F_OFD_SETLKW
99

1010

11+
# =======
12+
# <= 3.12
13+
# =======
14+
15+
# Added in Python 3.12.11 (parameter `escapable`)
16+
html.parser.HTMLParser.set_cdata_mode
17+
18+
1119
# =============================================================
1220
# Allowlist entries that cannot or should not be fixed; <= 3.12
1321
# =============================================================

stdlib/@tests/stubtest_allowlists/darwin-py39.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# =======
2+
# <= 3.12
3+
# =======
4+
5+
# Added in Python 3.9.23 (parameter `escapable`)
6+
html.parser.HTMLParser.set_cdata_mode
7+
8+
19
# =======
210
# <= 3.11
311
# =======

stdlib/@tests/stubtest_allowlists/win32-py310.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# =======
2+
# <= 3.12
3+
# =======
4+
5+
# Added in Python 3.10.18 (parameter `escapable`)
6+
html.parser.HTMLParser.set_cdata_mode
7+
8+
19
# =======
210
# <= 3.11
311
# =======

stdlib/@tests/stubtest_allowlists/win32-py311.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# =======
2+
# <= 3.12
3+
# =======
4+
5+
# Added in Python 3.11.13 (parameter `escapable`)
6+
html.parser.HTMLParser.set_cdata_mode
7+
8+
19
# =======
210
# <= 3.11
311
# =======

stdlib/@tests/stubtest_allowlists/win32-py312.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ _winapi.GetLongPathName
1616
_winapi.GetShortPathName
1717

1818

19+
# =======
20+
# <= 3.12
21+
# =======
22+
23+
# Added in Python 3.12.11 (parameter `escapable`)
24+
html.parser.HTMLParser.set_cdata_mode
25+
26+
1927
# =============================================================
2028
# Allowlist entries that cannot or should not be fixed; <= 3.12
2129
# =============================================================

stdlib/@tests/stubtest_allowlists/win32-py39.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# =======
2+
# <= 3.12
3+
# =======
4+
5+
# Added in Python 3.9.23 (parameter `escapable`)
6+
html.parser.HTMLParser.set_cdata_mode
7+
8+
19
# =======
210
# <= 3.11
311
# =======

stdlib/html/parser.pyi

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import sys
21
from _markupbase import ParserBase
32
from re import Pattern
43
from typing import Final
@@ -7,9 +6,8 @@ __all__ = ["HTMLParser"]
76

87
class HTMLParser(ParserBase):
98
CDATA_CONTENT_ELEMENTS: Final[tuple[str, ...]]
10-
if sys.version_info >= (3, 13):
11-
# Added in 3.13.6
12-
RCDATA_CONTENT_ELEMENTS: Final[tuple[str, ...]]
9+
# Added in Python 3.9.23, 3.10.18, 3.11.13, 3.12.11, 3.13.6
10+
RCDATA_CONTENT_ELEMENTS: Final[tuple[str, ...]]
1311

1412
def __init__(self, *, convert_charrefs: bool = True) -> None: ...
1513
def feed(self, data: str) -> None: ...
@@ -32,11 +30,8 @@ class HTMLParser(ParserBase):
3230
def parse_html_declaration(self, i: int) -> int: ... # undocumented
3331
def parse_pi(self, i: int) -> int: ... # undocumented
3432
def parse_starttag(self, i: int) -> int: ... # undocumented
35-
if sys.version_info >= (3, 13):
36-
# `escapable` parameter added in 3.13.6
37-
def set_cdata_mode(self, elem: str, *, escapable: bool = False) -> None: ... # undocumented
38-
else:
39-
def set_cdata_mode(self, elem: str) -> None: ... # undocumented
33+
# `escapable` parameter added in Python 3.9.23, 3.10.18, 3.11.13, 3.12.11, 3.13.6
34+
def set_cdata_mode(self, elem: str, *, escapable: bool = False) -> None: ... # undocumented
4035
rawdata: str # undocumented
4136
cdata_elem: str | None # undocumented
4237
convert_charrefs: bool # undocumented

0 commit comments

Comments
 (0)