Skip to content

Commit 1dcf19e

Browse files
chore(deps): bump https://github.com/pre-commit/mirrors-mypy from v2.1.0 to 2.3.0 (jxmorris12#229)
* chore(deps): bump https://github.com/pre-commit/mirrors-mypy Bumps [https://github.com/pre-commit/mirrors-mypy](https://github.com/pre-commit/mirrors-mypy) from v2.1.0 to 2.3.0. - [Commits](pre-commit/mirrors-mypy@v2.1.0...v2.3.0) --- updated-dependencies: - dependency-name: https://github.com/pre-commit/mirrors-mypy dependency-version: 2.3.0 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: mdevolde <martin.devolder2@gmail.com> * refactor(server): fix mypy [misc] warning --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mdevolde <martin.devolder2@gmail.com>
1 parent 7babe3a commit 1dcf19e

4 files changed

Lines changed: 172 additions & 164 deletions

File tree

‎.pre-commit-config.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ repos:
1111

1212
# mypy for type checking
1313
- repo: https://github.com/pre-commit/mirrors-mypy
14-
rev: v2.1.0 # Keep in sync mypy version with pyproject.toml
14+
rev: v2.3.0 # Keep in sync mypy version with pyproject.toml
1515
hooks:
1616
- id: mypy
1717
args: [--config-file=pyproject.toml]

‎pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ types = [
6161

6262
quality = [
6363
# Keep in sync mypy version with .pre-commit-config.yaml
64-
"mypy==2.1.0",
64+
"mypy==2.3.0",
6565
# Keep in sync ruff version with .pre-commit-config.yaml
6666
"ruff==0.15.22",
6767
# Keep in sync zizmor version with .pre-commit-config.yaml

‎src/language_tool_python/server.py‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import time
1616
import urllib.parse
1717
import warnings
18-
from typing import TYPE_CHECKING, ClassVar, Literal
18+
from typing import TYPE_CHECKING, ClassVar, Literal, cast
1919

2020
import psutil
2121
import requests
@@ -54,6 +54,7 @@
5454
from collections.abc import Mapping
5555
from pathlib import Path
5656
from types import TracebackType
57+
from typing import IO
5758

5859
from .config_file import ConfigValue
5960

@@ -1236,8 +1237,11 @@ def _terminate_server(self) -> None:
12361237
with contextlib.suppress(ValueError):
12371238
_RUNNING_SERVER_PROCESSES.remove(self._server)
12381239

1239-
if self._server.stdin:
1240-
self._server.stdin.close()
1240+
# stdin is IO[Any], so cast it back to the
1241+
# text stream that text=True actually gives us
1242+
stdin = cast("IO[str] | None", self._server.stdin)
1243+
if stdin:
1244+
stdin.close()
12411245

12421246
# Release the server process object
12431247
self._server = None

0 commit comments

Comments
 (0)