[warnings]: Update _ActionKind to match Python 3.14 (#12243)

This commit is contained in:
Kirill Podoprigora
2024-07-12 03:15:32 +03:00
committed by GitHub
parent 4316e00c9e
commit ed34247cfa

View File

@@ -21,8 +21,10 @@ if sys.version_info >= (3, 13):
_T = TypeVar("_T")
_W = TypeVar("_W", bound=list[WarningMessage] | None)
_ActionKind: TypeAlias = Literal["default", "error", "ignore", "always", "module", "once"]
if sys.version_info >= (3, 14):
_ActionKind: TypeAlias = Literal["default", "error", "ignore", "always", "module", "once"]
else:
_ActionKind: TypeAlias = Literal["default", "error", "ignore", "always", "all", "module", "once"]
filters: Sequence[tuple[str, str | None, type[Warning], str | None, int]] # undocumented, do not mutate
def showwarning(