diff --git a/stdlib/@tests/stubtest_allowlists/py315.txt b/stdlib/@tests/stubtest_allowlists/py315.txt index b93738f041ec..4c9f3292ff5d 100644 --- a/stdlib/@tests/stubtest_allowlists/py315.txt +++ b/stdlib/@tests/stubtest_allowlists/py315.txt @@ -8,7 +8,6 @@ _frozen_importlib_external.SourceLoader.source_to_code dataclasses.MISSING dataclasses._MISSING_TYPE dataclasses.field -mailbox._ProxyFile.__class_getitem__ # ============================================================= # Allowlist entries that cannot or should not be fixed; >= 3.15 diff --git a/stdlib/mailbox.pyi b/stdlib/mailbox.pyi index 4215120a5753..7f3024094b43 100644 --- a/stdlib/mailbox.pyi +++ b/stdlib/mailbox.pyi @@ -294,7 +294,8 @@ class _ProxyFile: def flush(self) -> None: ... @property def closed(self) -> bool: ... - def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... + if sys.version_info < (3, 15): + def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... class _PartialFile(_ProxyFile): def __init__(self, f: _GetFileReturn, start: int | None = None, stop: int | None = None) -> None: ...