mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2025-12-31 20:36:24 +00:00
run lint and fix errors, except mypy
This commit is contained in:
@ -1,10 +1,23 @@
|
||||
from libp2p.exceptions import ParseError
|
||||
from libp2p.io.abc import ReadWriteCloser
|
||||
from libp2p.io.exceptions import IOException
|
||||
from libp2p.utils import encode_delim, read_delim
|
||||
from libp2p.exceptions import (
|
||||
ParseError,
|
||||
)
|
||||
from libp2p.io.abc import (
|
||||
ReadWriteCloser,
|
||||
)
|
||||
from libp2p.io.exceptions import (
|
||||
IOException,
|
||||
)
|
||||
from libp2p.utils import (
|
||||
encode_delim,
|
||||
read_delim,
|
||||
)
|
||||
|
||||
from .exceptions import MultiselectCommunicatorError
|
||||
from .multiselect_communicator_interface import IMultiselectCommunicator
|
||||
from .exceptions import (
|
||||
MultiselectCommunicatorError,
|
||||
)
|
||||
from .multiselect_communicator_interface import (
|
||||
IMultiselectCommunicator,
|
||||
)
|
||||
|
||||
|
||||
class MultiselectCommunicator(IMultiselectCommunicator):
|
||||
@ -16,7 +29,7 @@ class MultiselectCommunicator(IMultiselectCommunicator):
|
||||
async def write(self, msg_str: str) -> None:
|
||||
"""
|
||||
:raise MultiselectCommunicatorError: raised when failed to write to underlying reader
|
||||
"""
|
||||
""" # noqa: E501
|
||||
msg_bytes = encode_delim(msg_str.encode())
|
||||
try:
|
||||
await self.read_writer.write(msg_bytes)
|
||||
@ -28,7 +41,7 @@ class MultiselectCommunicator(IMultiselectCommunicator):
|
||||
async def read(self) -> str:
|
||||
"""
|
||||
:raise MultiselectCommunicatorError: raised when failed to read from underlying reader
|
||||
"""
|
||||
""" # noqa: E501
|
||||
try:
|
||||
data = await read_delim(self.read_writer)
|
||||
# `IOException` includes `IncompleteReadError` and `StreamError`
|
||||
|
||||
Reference in New Issue
Block a user