[pre-commit.ci] pre-commit autoupdate (#12380)

* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.4.4 → v0.4.5](https://github.com/astral-sh/ruff-pre-commit/compare/v0.4.4...v0.4.5)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
pre-commit-ci[bot] 2024-05-27 22:31:18 +00:00 committed by GitHub
parent 88fae23bdd
commit 48cb8a2b32
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 9 additions and 9 deletions

View File

@ -1,6 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.4.4"
rev: "v0.4.5"
hooks:
- id: ruff
args: ["--fix"]

View File

@ -199,8 +199,8 @@ class TracebackEntry:
rawentry: TracebackType,
repr_style: Optional['Literal["short", "long"]'] = None,
) -> None:
self._rawentry: "Final" = rawentry
self._repr_style: "Final" = repr_style
self._rawentry: Final = rawentry
self._repr_style: Final = repr_style
def with_repr_style(
self, repr_style: Optional['Literal["short", "long"]']

View File

@ -1913,7 +1913,7 @@ def parse_warning_filter(
parts.append("")
action_, message, category_, module, lineno_ = (s.strip() for s in parts)
try:
action: "warnings._ActionKind" = warnings._getaction(action_) # type: ignore[attr-defined]
action: warnings._ActionKind = warnings._getaction(action_) # type: ignore[attr-defined]
except warnings._OptionError as e:
raise UsageError(error_template.format(error=str(e))) from None
try:

View File

@ -298,7 +298,7 @@ class DoctestItem(Item):
def runtest(self) -> None:
_check_all_skipped(self.dtest)
self._disable_output_capturing_for_darwin()
failures: List["doctest.DocTestFailure"] = []
failures: List[doctest.DocTestFailure] = []
# Type ignored because we change the type of `out` from what
# doctest expects.
self.runner.run(self.dtest, out=failures) # type: ignore[arg-type]

View File

@ -34,8 +34,8 @@ class catch_threading_exception:
"""
def __init__(self) -> None:
self.args: Optional["threading.ExceptHookArgs"] = None
self._old_hook: Optional[Callable[["threading.ExceptHookArgs"], Any]] = None
self.args: Optional[threading.ExceptHookArgs] = None
self._old_hook: Optional[Callable[[threading.ExceptHookArgs], Any]] = None
def _hook(self, args: "threading.ExceptHookArgs") -> None:
self.args = args

View File

@ -34,8 +34,8 @@ class catch_unraisable_exception:
"""
def __init__(self) -> None:
self.unraisable: Optional["sys.UnraisableHookArgs"] = None
self._old_hook: Optional[Callable[["sys.UnraisableHookArgs"], Any]] = None
self.unraisable: Optional[sys.UnraisableHookArgs] = None
self._old_hook: Optional[Callable[[sys.UnraisableHookArgs], Any]] = None
def _hook(self, unraisable: "sys.UnraisableHookArgs") -> None:
# Storing unraisable.object can resurrect an object which is being