Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error import #20

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions aioh2/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from .protocol import H2Protocol

__all__ = ['open_connection', 'start_server', 'async_task']
__all__ = ['open_connection', 'start_server']
if hasattr(socket, 'AF_UNIX'):
__all__.extend(['open_unix_connection', 'start_unix_server'])

Expand Down Expand Up @@ -82,8 +82,3 @@ def factory():
# noinspection PyArgumentList
return (yield from loop.create_unix_server(factory, path, **kwargs))


if hasattr(asyncio, 'ensure_future'): # Python >= 3.5
async_task = getattr(asyncio, 'ensure_future')
else:
async_task = getattr(asyncio, 'async')
7 changes: 6 additions & 1 deletion aioh2/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,16 @@
from h2.connection import H2Connection
from h2.exceptions import NoSuchStreamError, StreamClosedError, ProtocolError

from . import exceptions, async_task
from . import exceptions

__all__ = ['H2Protocol']
logger = getLogger(__package__)

if hasattr(asyncio, 'ensure_future'): # Python >= 3.5
async_task = getattr(asyncio, 'ensure_future')
else:
async_task = getattr(asyncio, 'async')


@asyncio.coroutine
def _wait_for_events(*events_):
Expand Down