Merge pull request #372 from ralexstokes/add-py36-compatibility

Add py36 compatibility
This commit is contained in:
Alex Stokes
2019-12-10 17:28:49 -08:00
committed by GitHub
11 changed files with 60 additions and 54 deletions

View File

@ -1,7 +1,8 @@
import asyncio
from contextlib import asynccontextmanager
from typing import Any, AsyncIterator, Dict, Tuple, cast
# NOTE: import ``asynccontextmanager`` from ``contextlib`` when support for python 3.6 is dropped.
from async_generator import asynccontextmanager
import factory
from libp2p import generate_new_rsa_identity, generate_peer_id_from
@ -173,7 +174,7 @@ async def host_pair_factory(is_secure: bool) -> Tuple[BasicHost, BasicHost]:
return hosts[0], hosts[1]
@asynccontextmanager
@asynccontextmanager # type: ignore
async def pair_of_connected_hosts(
is_secure: bool = True
) -> AsyncIterator[Tuple[BasicHost, BasicHost]]: