Skip to content

Commit 68d60a9

Browse files
committed
Bump to 2.0.1
1 parent c7d61a8 commit 68d60a9

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

CHANGES.rst

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
CHANGES
22
=======
33

4+
2.0.1 (2018-03-13)
5+
------------------
6+
7+
* Fix ``PendingDeprecationWarning`` on Python 3.7 (#33)
8+
9+
410
2.0.0 (2017-10-09)
511
------------------
612

async_timeout/__init__.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import asyncio
2+
import sys
23

34

4-
__version__ = '2.0.0'
5+
__version__ = '2.0.1'
6+
7+
PY_37 = sys.version_info >= (3, 7)
58

69

710
class timeout:
@@ -89,8 +92,12 @@ def _cancel_task(self):
8992

9093

9194
def current_task(loop):
92-
task = asyncio.Task.current_task(loop=loop)
95+
if PY_37:
96+
task = asyncio.current_task(loop=loop)
97+
else:
98+
task = asyncio.Task.current_task(loop=loop)
9399
if task is None:
100+
# this should be removed, tokio must use register_task and family API
94101
if hasattr(loop, 'current_task'):
95102
task = loop.current_task()
96103

0 commit comments

Comments
 (0)