Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 11, 2023
1 parent c160551 commit 9081b1e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion mypy/dmypy_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def _response_metadata(self) -> dict[str, str]:
def serve(self) -> None:
"""Serve requests, synchronously (no thread or fork)."""

class WriteToConn(object):
class WriteToConn:
def __init__(self, server: IPCBase, output_key: str = "stdout"):
self.server = server
self.output_key = output_key
Expand Down
1 change: 1 addition & 0 deletions mypy/dmypy_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def receive(connection: IPCBase) -> Any:
raise OSError(f"Data received is not a dict ({type(data)})")
return data


def send(connection: IPCBase, data: Any) -> None:
"""Send data to a connection encoded and framed.
Expand Down
6 changes: 3 additions & 3 deletions mypy/ipc.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import tempfile
from types import TracebackType
from typing import Callable, Final
from urllib.parse import quote,unquote
from urllib.parse import quote, unquote

if sys.platform == "win32":
# This may be private, but it is needed for IPC on Windows, and is basically stable
Expand Down Expand Up @@ -72,7 +72,7 @@ def read(self, size: int = 100000) -> str:
space_pos = self.buffer.find(b" ")
if space_pos != -1:
# We have a full frame
bdata = self.buffer[: space_pos]
bdata = self.buffer[:space_pos]
self.buffer = self.buffer[space_pos + 1 :]
break
if err == 0:
Expand All @@ -93,7 +93,7 @@ def read(self, size: int = 100000) -> str:
space_pos = self.buffer.find(b" ")
if space_pos != -1:
# We have a full frame
bdata = self.buffer[: space_pos]
bdata = self.buffer[:space_pos]
self.buffer = self.buffer[space_pos + 1 :]
break
return unquote(bytes(bdata).decode("utf8"))
Expand Down
1 change: 1 addition & 0 deletions mypy/test/testipc.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def server(msg: str, q: Queue[str]) -> None:
data = server.read()
server.cleanup()


def server_multi_message_echo(q: Queue[str]) -> None:
server = IPCServer(CONNECTION_NAME)
q.put(server.connection_name)
Expand Down

0 comments on commit 9081b1e

Please sign in to comment.