summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio/tasks.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-07-25 00:23:21 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2015-07-25 00:23:21 (GMT)
commit71080fc3518e2d3555f555340c3e93f3b108a5b8 (patch)
tree5125e65a9293873cf5d307dd5de1d093de74ea8a /Lib/asyncio/tasks.py
parentf05b79dbd286f6723ee717c31766c97551e4e34d (diff)
downloadcpython-71080fc3518e2d3555f555340c3e93f3b108a5b8.zip
cpython-71080fc3518e2d3555f555340c3e93f3b108a5b8.tar.gz
cpython-71080fc3518e2d3555f555340c3e93f3b108a5b8.tar.bz2
asyncio: Add asyncio.compat module
Move compatibility helpers for the different Python versions to a new asyncio.compat module.
Diffstat (limited to 'Lib/asyncio/tasks.py')
-rw-r--r--Lib/asyncio/tasks.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/Lib/asyncio/tasks.py b/Lib/asyncio/tasks.py
index d8193ba..1d5f865 100644
--- a/Lib/asyncio/tasks.py
+++ b/Lib/asyncio/tasks.py
@@ -16,13 +16,12 @@ import traceback
import warnings
import weakref
+from . import compat
from . import coroutines
from . import events
from . import futures
from .coroutines import coroutine
-_PY34 = (sys.version_info >= (3, 4))
-
class Task(futures.Future):
"""A coroutine wrapped in a Future."""
@@ -83,7 +82,7 @@ class Task(futures.Future):
# On Python 3.3 or older, objects with a destructor that are part of a
# reference cycle are never destroyed. That's not the case any more on
# Python 3.4 thanks to the PEP 442.
- if _PY34:
+ if compat.PY34:
def __del__(self):
if self._state == futures._PENDING and self._log_destroy_pending:
context = {