diff options
author | INADA Naoki <methane@users.noreply.github.com> | 2017-04-25 10:57:18 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-25 10:57:18 +0900 |
commit | 3e2ad8ec61a322370a6fbdfb2209cf74546f5e08 (patch) | |
tree | 0285efcc8b8d9b7215e4b8dbe106960187b1e628 /Lib/asyncio/tasks.py | |
parent | f6448e5d65c349576df6e83b8324b9c208e77615 (diff) | |
download | cpython-git-3e2ad8ec61a322370a6fbdfb2209cf74546f5e08.tar.gz |
bpo-29617: Remove Python 3.3 support from asyncio (GH-232)
Diffstat (limited to 'Lib/asyncio/tasks.py')
-rw-r--r-- | Lib/asyncio/tasks.py | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/Lib/asyncio/tasks.py b/Lib/asyncio/tasks.py index f91e70aecb..4fbcf3ed2e 100644 --- a/Lib/asyncio/tasks.py +++ b/Lib/asyncio/tasks.py @@ -76,20 +76,16 @@ class Task(futures.Future): self._loop.call_soon(self._step) self.__class__._all_tasks.add(self) - # 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 compat.PY34: - def __del__(self): - if self._state == futures._PENDING and self._log_destroy_pending: - context = { - 'task': self, - 'message': 'Task was destroyed but it is pending!', - } - if self._source_traceback: - context['source_traceback'] = self._source_traceback - self._loop.call_exception_handler(context) - futures.Future.__del__(self) + def __del__(self): + if self._state == futures._PENDING and self._log_destroy_pending: + context = { + 'task': self, + 'message': 'Task was destroyed but it is pending!', + } + if self._source_traceback: + context['source_traceback'] = self._source_traceback + self._loop.call_exception_handler(context) + futures.Future.__del__(self) def _repr_info(self): return base_tasks._task_repr_info(self) |