Skip to content

Commit a21cae0

Browse files
authored
Drop redundant int cast in _new_main (#148)
ty 0.0.43 flags `cast("int", _original_main(argv))` as a `redundant-cast` warning since the value is already typed `int`, and `--error-on-warning` makes the `type` job fail. This blocks unrelated PRs such as #147. Remove the cast and its now-unused `typing.cast` import.
1 parent 943e7ab commit a21cae0

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/pre_commit_uv/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ def _patch() -> None:
5454
def _new_main(argv: Sequence[str] | None = None) -> int:
5555
# imports applied locally to avoid patching import overhead cost
5656
from functools import cache # noqa: PLC0415
57-
from typing import cast # noqa: PLC0415
5857

5958
from pre_commit.languages import python # noqa: PLC0415
6059

@@ -135,4 +134,4 @@ def _version_info(exe: str) -> str:
135134
python.install_environment = _install_environment # ty: ignore[invalid-assignment]
136135
python._version_info = _version_info # noqa: SLF001
137136
assert _original_main is not None # noqa: S101
138-
return cast("int", _original_main(argv))
137+
return _original_main(argv)

0 commit comments

Comments
 (0)