Drop Python 3.8 branches (#13776)

This commit is contained in:
Sebastian Rittau
2025-04-03 10:35:36 +02:00
committed by GitHub
parent 1e43190554
commit 30b16c168d
117 changed files with 1023 additions and 2639 deletions
+3 -10
View File
@@ -1,4 +1,3 @@
import sys
from _typeshed import FileDescriptorOrPath
from typing import Final, Literal, Protocol, overload
from xml.etree.ElementTree import Element
@@ -13,8 +12,7 @@ XINCLUDE: Final[str]
XINCLUDE_INCLUDE: Final[str]
XINCLUDE_FALLBACK: Final[str]
if sys.version_info >= (3, 9):
DEFAULT_MAX_INCLUSION_DEPTH: Final = 6
DEFAULT_MAX_INCLUSION_DEPTH: Final = 6
class FatalIncludeError(SyntaxError): ...
@@ -22,11 +20,6 @@ class FatalIncludeError(SyntaxError): ...
def default_loader(href: FileDescriptorOrPath, parse: Literal["xml"], encoding: str | None = None) -> Element: ...
@overload
def default_loader(href: FileDescriptorOrPath, parse: Literal["text"], encoding: str | None = None) -> str: ...
def include(elem: Element, loader: _Loader | None = None, base_url: str | None = None, max_depth: int | None = 6) -> None: ...
if sys.version_info >= (3, 9):
def include(elem: Element, loader: _Loader | None = None, base_url: str | None = None, max_depth: int | None = 6) -> None: ...
class LimitedRecursiveIncludeError(FatalIncludeError): ...
else:
def include(elem: Element, loader: _Loader | None = None) -> None: ...
class LimitedRecursiveIncludeError(FatalIncludeError): ...
+2 -13
View File
@@ -15,6 +15,7 @@ __all__ = [
"canonicalize",
"fromstring",
"fromstringlist",
"indent",
"iselement",
"iterparse",
"parse",
@@ -34,9 +35,6 @@ __all__ = [
"register_namespace",
]
if sys.version_info >= (3, 9):
__all__ += ["indent"]
_T = TypeVar("_T")
_FileRead: TypeAlias = FileDescriptorOrPath | SupportsRead[bytes] | SupportsRead[str]
_FileWriteC14N: TypeAlias = FileDescriptorOrPath | SupportsWrite[bytes]
@@ -138,9 +136,6 @@ class Element(Generic[_Tag]):
# Doesn't really exist in earlier versions, where __len__ is called implicitly instead
@deprecated("Testing an element's truth value is deprecated.")
def __bool__(self) -> bool: ...
if sys.version_info < (3, 9):
def getchildren(self) -> list[Element]: ...
def getiterator(self, tag: str | None = None) -> list[Element]: ...
def SubElement(parent: Element, tag: str, attrib: dict[str, str] = ..., **extra: str) -> Element: ...
def Comment(text: str | None = None) -> _CallableElement: ...
@@ -165,9 +160,6 @@ class ElementTree(Generic[_Root]):
def getroot(self) -> _Root: ...
def parse(self, source: _FileRead, parser: XMLParser | None = None) -> Element: ...
def iter(self, tag: str | None = None) -> Generator[Element, None, None]: ...
if sys.version_info < (3, 9):
def getiterator(self, tag: str | None = None) -> list[Element]: ...
def find(self, path: str, namespaces: dict[str, str] | None = None) -> Element | None: ...
@overload
def findtext(self, path: str, default: None = None, namespaces: dict[str, str] | None = None) -> str | None: ...
@@ -254,10 +246,7 @@ def tostringlist(
short_empty_elements: bool = True,
) -> list[Any]: ...
def dump(elem: Element | ElementTree[Any]) -> None: ...
if sys.version_info >= (3, 9):
def indent(tree: Element | ElementTree[Any], space: str = " ", level: int = 0) -> None: ...
def indent(tree: Element | ElementTree[Any], space: str = " ", level: int = 0) -> None: ...
def parse(source: _FileRead, parser: XMLParser[Any] | None = None) -> ElementTree[Element]: ...
# This class is defined inside the body of iterparse