diff --git a/stdlib/@tests/stubtest_allowlists/py315.txt b/stdlib/@tests/stubtest_allowlists/py315.txt index 7354dac4dc90..38ae4bfef87e 100644 --- a/stdlib/@tests/stubtest_allowlists/py315.txt +++ b/stdlib/@tests/stubtest_allowlists/py315.txt @@ -28,8 +28,6 @@ importlib.abc.InspectLoader.source_to_code importlib.abc.MetaPathFinder.discover importlib.abc.PathEntryFinder.discover importlib.resources._common.package_to_anchor -mailbox.Mailbox.__enter__ -mailbox.Mailbox.__exit__ mailbox._ProxyFile.__class_getitem__ multiprocessing.process.BaseProcess.__init__ threading.Condition.locked diff --git a/stdlib/mailbox.pyi b/stdlib/mailbox.pyi index 961c0f5e81f7..4215120a5753 100644 --- a/stdlib/mailbox.pyi +++ b/stdlib/mailbox.pyi @@ -129,6 +129,11 @@ class Mailbox(Generic[_MessageT_co]): def unlock(self) -> None: ... @abstractmethod def close(self) -> None: ... + if sys.version_info >= (3, 15): + def __enter__(self) -> Self: ... + def __exit__( + self, type: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None + ) -> None: ... # Undocumented, called by subclasses to parse added messages. def _dump_message(self, message: _MessageData, target: SupportsWrite[bytes], mangle_from_: bool = False) -> None: ... def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...