diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2015-07-25 00:23:21 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2015-07-25 00:23:21 (GMT) |
commit | 71080fc3518e2d3555f555340c3e93f3b108a5b8 (patch) | |
tree | 5125e65a9293873cf5d307dd5de1d093de74ea8a /Lib/asyncio/coroutines.py | |
parent | f05b79dbd286f6723ee717c31766c97551e4e34d (diff) | |
download | cpython-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/coroutines.py')
-rw-r--r-- | Lib/asyncio/coroutines.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Lib/asyncio/coroutines.py b/Lib/asyncio/coroutines.py index 15475f2..e11b21b 100644 --- a/Lib/asyncio/coroutines.py +++ b/Lib/asyncio/coroutines.py @@ -9,14 +9,12 @@ import sys import traceback import types +from . import compat from . import events from . import futures from .log import logger -_PY35 = sys.version_info >= (3, 5) - - # Opcode of "yield from" instruction _YIELD_FROM = opcode.opmap['YIELD_FROM'] @@ -140,7 +138,7 @@ class CoroWrapper: def gi_code(self): return self.gen.gi_code - if _PY35: + if compat.PY35: __await__ = __iter__ # make compatible with 'await' expression |