Skip to content

Commit

Permalink
Bump to 2.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
asvetlov committed Mar 13, 2018
1 parent c7d61a8 commit 68d60a9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
CHANGES
=======

2.0.1 (2018-03-13)
------------------

* Fix ``PendingDeprecationWarning`` on Python 3.7 (#33)


2.0.0 (2017-10-09)
------------------

Expand Down
11 changes: 9 additions & 2 deletions async_timeout/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import asyncio
import sys


__version__ = '2.0.0'
__version__ = '2.0.1'

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


class timeout:
Expand Down Expand Up @@ -89,8 +92,12 @@ def _cancel_task(self):


def current_task(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 68d60a9

Please sign in to comment.