diff options
| author | Victor Stinner <victor.stinner@gmail.com> | 2015-07-25 00:43:31 (GMT) |
|---|---|---|
| committer | Victor Stinner <victor.stinner@gmail.com> | 2015-07-25 00:43:31 (GMT) |
| commit | 389e3d768d8f5bd312476db795f6432651bc656b (patch) | |
| tree | e97e07d562b934dd0b4159ddb3d26203e0f7908a /Lib/asyncio/futures.py | |
| parent | 71f70b8f1a87ee3fc2750776eb24d8c906884f84 (diff) | |
| parent | eaf16abc68a09e2d976c37e34eb606f5b519f7ea (diff) | |
| download | cpython-389e3d768d8f5bd312476db795f6432651bc656b.zip cpython-389e3d768d8f5bd312476db795f6432651bc656b.tar.gz cpython-389e3d768d8f5bd312476db795f6432651bc656b.tar.bz2 | |
Merge 3.4
Diffstat (limited to 'Lib/asyncio/futures.py')
| -rw-r--r-- | Lib/asyncio/futures.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/Lib/asyncio/futures.py b/Lib/asyncio/futures.py index d06828a..dbe06c4 100644 --- a/Lib/asyncio/futures.py +++ b/Lib/asyncio/futures.py @@ -11,6 +11,7 @@ import reprlib import sys import traceback +from . import compat from . import events # States for Future. @@ -18,9 +19,6 @@ _PENDING = 'PENDING' _CANCELLED = 'CANCELLED' _FINISHED = 'FINISHED' -_PY34 = sys.version_info >= (3, 4) -_PY35 = sys.version_info >= (3, 5) - Error = concurrent.futures._base.Error CancelledError = concurrent.futures.CancelledError TimeoutError = concurrent.futures.TimeoutError @@ -199,7 +197,7 @@ class Future: # On Python 3.3 and older, objects with a destructor part of a reference # cycle are never destroyed. It's not more the case on Python 3.4 thanks # to the PEP 442. - if _PY34: + if compat.PY34: def __del__(self): if not self._log_traceback: # set_exception() was not called, or result() or exception() @@ -352,7 +350,7 @@ class Future: self._exception = exception self._state = _FINISHED self._schedule_callbacks() - if _PY34: + if compat.PY34: self._log_traceback = True else: self._tb_logger = _TracebackLogger(self, exception) @@ -388,7 +386,7 @@ class Future: assert self.done(), "yield from wasn't used with future" return self.result() # May raise too. - if _PY35: + if compat.PY35: __await__ = __iter__ # make compatible with 'await' expression |
