Skip to content

Commit

Permalink
Bump to aiohttp 3.0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
asvetlov committed Mar 13, 2018
1 parent 5d68740 commit c4058a4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ Changelog

.. towncrier release notes start
3.0.8 (2018-03-12)
==================

- Use ``asyncio.current_task()`` on Python 3.7 (#2825)

3.0.7 (2018-03-08)
==================

Expand Down
2 changes: 1 addition & 1 deletion aiohttp/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '3.0.7'
__version__ = '3.0.8'

# This relies on each of the submodules having an __all__ variable.

Expand Down
9 changes: 7 additions & 2 deletions aiohttp/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@
__all__ = ('BasicAuth',)

PY_36 = sys.version_info >= (3, 6)
PY_37 = sys.version_info >= (3, 7)

if sys.version_info < (3, 7):
if not PY_37:
import idna_ssl
idna_ssl.patch_match_hostname()

Expand Down Expand Up @@ -183,8 +184,12 @@ def current_task(loop=None):
if loop is None:
loop = asyncio.get_event_loop()

task = asyncio.Task.current_task(loop=loop)
if PY_37:
task = asyncio.current_task(loop=loop)
else:
task = asyncio.Task.current_task(loop=loop)
if task is None:
# this should be removed, tokio must use register_task and family API
if hasattr(loop, 'current_task'):
task = loop.current_task()

Expand Down

0 comments on commit c4058a4

Please sign in to comment.