diff --git a/stdlib/@tests/stubtest_allowlists/py314.txt b/stdlib/@tests/stubtest_allowlists/py314.txt index 084d86618..a2bd88b69 100644 --- a/stdlib/@tests/stubtest_allowlists/py314.txt +++ b/stdlib/@tests/stubtest_allowlists/py314.txt @@ -399,8 +399,6 @@ io.__all__ io.Reader io.Writer ipaddress._IPAddressBase.version -logging.handlers.QueueListener.__enter__ -logging.handlers.QueueListener.__exit__ logging.handlers.SysLogHandler.__init__ marshal.dump marshal.dumps diff --git a/stdlib/logging/handlers.pyi b/stdlib/logging/handlers.pyi index 2c7ec05af..b58999e9d 100644 --- a/stdlib/logging/handlers.pyi +++ b/stdlib/logging/handlers.pyi @@ -8,7 +8,9 @@ from logging import FileHandler, Handler, LogRecord from re import Pattern from socket import SocketKind, socket from threading import Thread +from types import TracebackType from typing import Any, ClassVar, Final, Protocol, TypeVar +from typing_extensions import Self _T = TypeVar("_T") @@ -237,3 +239,9 @@ class QueueListener: def stop(self) -> None: ... def enqueue_sentinel(self) -> None: ... def handle(self, record: LogRecord) -> None: ... + + if sys.version_info >= (3, 14): + def __enter__(self) -> Self: ... + def __exit__( + self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None + ) -> None: ...