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/locks.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/locks.py')
-rw-r--r-- | Lib/asyncio/locks.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Lib/asyncio/locks.py b/Lib/asyncio/locks.py index b2e516b..cc6f2bf 100644 --- a/Lib/asyncio/locks.py +++ b/Lib/asyncio/locks.py @@ -5,14 +5,12 @@ __all__ = ['Lock', 'Event', 'Condition', 'Semaphore', 'BoundedSemaphore'] import collections import sys +from . import compat from . import events from . import futures from .coroutines import coroutine -_PY35 = sys.version_info >= (3, 5) - - class _ContextManager: """Context manager. @@ -70,7 +68,7 @@ class _ContextManagerMixin: yield from self.acquire() return _ContextManager(self) - if _PY35: + if compat.PY35: def __await__(self): # To make "with await lock" work. |