We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c7d61a8 commit 68d60a9Copy full SHA for 68d60a9
CHANGES.rst
@@ -1,6 +1,12 @@
1
CHANGES
2
=======
3
4
+2.0.1 (2018-03-13)
5
+------------------
6
+
7
+* Fix ``PendingDeprecationWarning`` on Python 3.7 (#33)
8
9
10
2.0.0 (2017-10-09)
11
------------------
12
async_timeout/__init__.py
@@ -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:
@@ -89,8 +92,12 @@ def _cancel_task(self):
89
92
90
93
91
94
def current_task(loop):
- 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)
99
if task is None:
100
+ # this should be removed, tokio must use register_task and family API
101
if hasattr(loop, 'current_task'):
102
task = loop.current_task()
103
0 commit comments