Skip to content

Commit

Permalink
Fix mypy and flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
alecmev committed Aug 10, 2022
1 parent bdcd755 commit 47fde0d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
9 changes: 5 additions & 4 deletions plugin/core/transports.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ def on_stderr_message(self, message: str) -> None:

class AbstractProcessor(Generic[T]):

def write_data(self, writer: IO[bytes], data: T) -> None:
def write_data(self, writer: Any, data: T) -> None:
raise NotImplementedError()

def read_data(self, reader: IO[bytes]) -> Optional[T]:
def read_data(self, reader: Any) -> Optional[T]:
raise NotImplementedError()


Expand Down Expand Up @@ -242,6 +242,7 @@ def _stderr_loop(self) -> None:
exception_log('unexpected exception type in stderr loop', ex)
self._send_queue.put_nowait(None)


# Can be a singleton since it doesn't hold any state.
standard_processor = StandardProcessor()
node_ipc_processor = NodeIpcProcessor()
Expand Down Expand Up @@ -290,7 +291,7 @@ def start_subprocess() -> subprocess.Popen:
raise RuntimeError("Failed to connect on port {}".format(config.tcp_port))
reader = writer = sock.makefile('rwb')
elif config.node_ipc:
reader = writer = config.node_ipc.parent_connection
reader = writer = config.node_ipc.parent_connection # type: ignore
else:
if not process.stdout or not process.stdin:
raise RuntimeError(
Expand All @@ -300,7 +301,7 @@ def start_subprocess() -> subprocess.Popen:
reader = process.stdout
writer = process.stdin
stderr_reader = process.stdout if config.node_ipc else process.stderr
processor = node_ipc_processor if config.node_ipc else standard_processor
processor = node_ipc_processor if config.node_ipc else standard_processor

if not reader or not writer:
raise RuntimeError('Failed initializing transport: reader: {}, writer: {}'.format(reader, writer))
Expand Down
1 change: 0 additions & 1 deletion plugin/core/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from wcmatch.glob import BRACE
from wcmatch.glob import globmatch
from wcmatch.glob import GLOBSTAR
import collections
import contextlib
import fnmatch
import multiprocessing
Expand Down

0 comments on commit 47fde0d

Please sign in to comment.