From d9f80930ce9b6d457024123af524e4d17e89b368 Mon Sep 17 00:00:00 2001 From: donbarbos Date: Sun, 30 Aug 2026 12:58:24 +0400 Subject: [PATCH] [mailbox] Remove _ProxyFile.__class_getitem__ in Python 3.15 Source: https://github.com/python/cpython/pull/140838 --- stdlib/@tests/stubtest_allowlists/py315.txt | 1 - stdlib/mailbox.pyi | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) 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: ...