Fix warnings.filters type (#12866)

Fixes #12828
This commit is contained in:
Aaron Z.
2024-10-21 13:11:22 +01:00
committed by GitHub
parent 8d02c2a6df
commit 3a48a1298f

View File

@@ -1,4 +1,5 @@
import sys
import re
from _warnings import warn as warn, warn_explicit as warn_explicit
from collections.abc import Sequence
from types import ModuleType, TracebackType
@@ -25,7 +26,7 @@ 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
filters: Sequence[tuple[str, re.Pattern[str] | None, type[Warning], re.Pattern[str] | None, int]] # undocumented, do not mutate
def showwarning(
message: Warning | str,