Add Python 3.5 compatibility

Close #4
This commit is contained in:
Pedro Ferreira
2017-08-01 22:06:29 +02:00
parent 30d2ec4209
commit 3831485ff3
5 changed files with 19 additions and 3 deletions

View File

@@ -21,6 +21,8 @@
from asyncio import open_connection, start_server, ensure_future
from async_generator import async_generator, yield_
from .boxstream import get_stream_pair
from .crypto import SHSClientCrypto, SHSServerCrypto
@@ -43,9 +45,10 @@ class SHSSocket(object):
def disconnect(self):
self.writer.close()
@async_generator
async def __aiter__(self):
async for msg in self.read_stream:
yield msg
await yield_(msg)
def on_connect(self, cb):
self._on_connect = cb