Skip to content

Commit 295d2e0

Browse files
committed
Add expat XMLParser methods
These were added in point releases Closes: #15104
1 parent 11b39b8 commit 295d2e0

4 files changed

Lines changed: 40 additions & 0 deletions

File tree

stdlib/@tests/stubtest_allowlists/py310.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
# =========
2+
# Temporary
3+
# =========
4+
5+
6+
# Will be added in 3.10.20
7+
pyexpat.XMLParserType.SetAllocTrackerActivationThreshold
8+
pyexpat.XMLParserType.SetAllocTrackerMaximumAmplification
9+
xml.parsers.expat.XMLParserType.SetAllocTrackerActivationThreshold
10+
xml.parsers.expat.XMLParserType.SetAllocTrackerMaximumAmplification
11+
12+
113
# =========================
214
# New errors in Python 3.10
315
# =========================

stdlib/@tests/stubtest_allowlists/py311.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
# =========
2+
# Temporary
3+
# =========
4+
5+
6+
# Will be added in 3.11.15
7+
pyexpat.XMLParserType.SetAllocTrackerActivationThreshold
8+
pyexpat.XMLParserType.SetAllocTrackerMaximumAmplification
9+
xml.parsers.expat.XMLParserType.SetAllocTrackerActivationThreshold
10+
xml.parsers.expat.XMLParserType.SetAllocTrackerMaximumAmplification
11+
12+
113
# =========================
214
# New errors in Python 3.11
315
# =========================

stdlib/@tests/stubtest_allowlists/py312.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
# =========
2+
# Temporary
3+
# =========
4+
5+
# Will be added in 3.12.13
6+
pyexpat.XMLParserType.SetAllocTrackerActivationThreshold
7+
pyexpat.XMLParserType.SetAllocTrackerMaximumAmplification
8+
xml.parsers.expat.XMLParserType.SetAllocTrackerActivationThreshold
9+
xml.parsers.expat.XMLParserType.SetAllocTrackerMaximumAmplification
10+
11+
112
# =========================
213
# New errors in Python 3.12
314
# =========================

stdlib/pyexpat/__init__.pyi

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ from _typeshed import ReadableBuffer, SupportsRead
22
from collections.abc import Callable
33
from pyexpat import errors as errors, model as model
44
from typing import Any, Final, final
5+
from psycopg2.extensions import Int
56
from typing_extensions import CapsuleType, TypeAlias
67
from xml.parsers.expat import ExpatError as ExpatError
78

@@ -29,6 +30,10 @@ class XMLParserType:
2930
def UseForeignDTD(self, flag: bool = True, /) -> None: ...
3031
def GetReparseDeferralEnabled(self) -> bool: ...
3132
def SetReparseDeferralEnabled(self, enabled: bool, /) -> None: ...
33+
# Added in Python 3.10.20, 3.11.15, 3.12.3, 3.13.10, 3.14.1
34+
def SetAllocTrackerActivationThreshold(self, threshold: int, /) -> None: ...
35+
def SetAllocTrackerMaximumAmplification(self, max_factor: float, /) -> None: ...
36+
3237
@property
3338
def intern(self) -> dict[str, str]: ...
3439
buffer_size: int

0 commit comments

Comments
 (0)