Fix linting

This commit is contained in:
mhchia 2019-09-09 17:05:06 +08:00
parent 0ab548aee5
commit df312f3e57
No known key found for this signature in database
GPG Key ID: 389EFBEA1362589A
2 changed files with 4 additions and 3 deletions

View File

@ -8,6 +8,7 @@ from .datastructures import StreamID
from .exceptions import MplexStreamClosed, MplexStreamEOF, MplexStreamReset
if TYPE_CHECKING:
from typing import Any # noqa: F401
from libp2p.stream_muxer.mplex.mplex import Mplex
@ -67,8 +68,9 @@ class MplexStream(IMuxedStream):
fut.cancel()
if self.event_reset.is_set():
raise MplexStreamReset
done_task = tuple(done)[0]
if done_task._coro.__qualname__ == "Queue.get":
done_task = cast("asyncio.Task[Any]", tuple(done)[0])
# TODO: `_coro` is not in `asyncio.Task`'s typeshed.
if done_task._coro.__qualname__ == "Queue.get": # type: ignore
data = done_task.result()
self._buf.extend(data)
return

View File

@ -15,7 +15,6 @@ from libp2p.security.base_transport import BaseSecureTransport
from libp2p.security.insecure.transport import PLAINTEXT_PROTOCOL_ID, InsecureTransport
import libp2p.security.secio.transport as secio
from libp2p.stream_muxer.mplex.mplex import Mplex
from libp2p.stream_muxer.mplex.mplex_stream import MplexStream
from libp2p.typing import TProtocol
from tests.configs import LISTEN_MADDR
from tests.pubsub.configs import (