Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repos:

# mypy for type checking
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v2.1.0 # Keep in sync mypy version with pyproject.toml
rev: v2.3.0 # Keep in sync mypy version with pyproject.toml
hooks:
- id: mypy
args: [--config-file=pyproject.toml]
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ types = [

quality = [
# Keep in sync mypy version with .pre-commit-config.yaml
"mypy==2.1.0",
"mypy==2.3.0",
# Keep in sync ruff version with .pre-commit-config.yaml
"ruff==0.15.22",
# Keep in sync zizmor version with .pre-commit-config.yaml
Expand Down
10 changes: 7 additions & 3 deletions src/language_tool_python/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import time
import urllib.parse
import warnings
from typing import TYPE_CHECKING, ClassVar, Literal
from typing import TYPE_CHECKING, ClassVar, Literal, cast

import psutil
import requests
Expand Down Expand Up @@ -54,6 +54,7 @@
from collections.abc import Mapping
from pathlib import Path
from types import TracebackType
from typing import IO
Comment thread
mdevolde marked this conversation as resolved.
Dismissed

from .config_file import ConfigValue

Expand Down Expand Up @@ -1236,8 +1237,11 @@
with contextlib.suppress(ValueError):
_RUNNING_SERVER_PROCESSES.remove(self._server)

if self._server.stdin:
self._server.stdin.close()
# stdin is IO[Any], so cast it back to the
# text stream that text=True actually gives us
stdin = cast("IO[str] | None", self._server.stdin)
if stdin:
stdin.close()

# Release the server process object
self._server = None
Expand Down
Loading
Loading