Fixes to add python 3.6 compatibility

This commit is contained in:
Alex Stokes
2019-12-02 15:57:22 -08:00
parent dfdcf524b7
commit 63fd531ed0
9 changed files with 54 additions and 53 deletions

View File

@ -1,5 +1,4 @@
import asyncio
from contextlib import asynccontextmanager
from typing import Any, AsyncIterator, Dict, Tuple, cast
import factory
@ -33,6 +32,12 @@ from .constants import (
)
from .utils import connect, connect_swarm
try:
from contextlib import asynccontextmanager
except ImportError:
# NOTE: mypy complains about a duplicate import without the following ``# type: ignore``
from async_generator import asynccontextmanager # type: ignore
def initialize_peerstore_with_our_keypair(self_id: ID, key_pair: KeyPair) -> PeerStore:
peer_store = PeerStore()