mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-15 16:27:08 +08:00
Fix stdlib stubtest after latest typing-extensions release (#11923)
This commit is contained in:
@@ -3,7 +3,7 @@ from _warnings import warn as warn, warn_explicit as warn_explicit
|
||||
from collections.abc import Sequence
|
||||
from types import ModuleType, TracebackType
|
||||
from typing import Any, Generic, Literal, TextIO, TypeVar, overload
|
||||
from typing_extensions import TypeAlias
|
||||
from typing_extensions import LiteralString, TypeAlias
|
||||
|
||||
__all__ = [
|
||||
"warn",
|
||||
@@ -16,6 +16,10 @@ __all__ = [
|
||||
"catch_warnings",
|
||||
]
|
||||
|
||||
if sys.version_info >= (3, 13):
|
||||
__all__ += ["deprecated"]
|
||||
|
||||
_T = TypeVar("_T")
|
||||
_W = TypeVar("_W", bound=list[WarningMessage] | None)
|
||||
_ActionKind: TypeAlias = Literal["default", "error", "ignore", "always", "module", "once"]
|
||||
|
||||
@@ -110,3 +114,11 @@ class catch_warnings(Generic[_W]):
|
||||
def __exit__(
|
||||
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
|
||||
) -> None: ...
|
||||
|
||||
if sys.version_info >= (3, 13):
|
||||
class deprecated:
|
||||
message: LiteralString
|
||||
category: type[Warning] | None
|
||||
stacklevel: int
|
||||
def __init__(self, message: LiteralString, /, *, category: type[Warning] | None = ..., stacklevel: int = 1) -> None: ...
|
||||
def __call__(self, arg: _T, /) -> _T: ...
|
||||
|
||||
Reference in New Issue
Block a user