[Python-checkins] asyncio: Remove unused Future._tb_logger attribute (GH-4596) (#4598)
Victor Stinner
webhook-mailer at python.org
Tue Nov 28 04:32:31 EST 2017
https://github.com/python/cpython/commit/f54e40520098f8e28bb1dd8d8f0a79316d5ea7fc
commit: f54e40520098f8e28bb1dd8d8f0a79316d5ea7fc
branch: 3.6
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: Victor Stinner <victor.stinner at gmail.com>
date: 2017年11月28日T10:32:28+01:00
summary:
asyncio: Remove unused Future._tb_logger attribute (GH-4596) (#4598)
It was only used on Python 3.3, now only Future._log_traceback is
used.
(cherry picked from commit c16bacec3c2f08a74e4dc282f7d84f17ec70d0d5)
files:
M Lib/asyncio/futures.py
diff --git a/Lib/asyncio/futures.py b/Lib/asyncio/futures.py
index 047b132fcbb..9ff143039a3 100644
--- a/Lib/asyncio/futures.py
+++ b/Lib/asyncio/futures.py
@@ -143,8 +143,7 @@ class Future:
# `yield Future()` (incorrect).
_asyncio_future_blocking = False
- _log_traceback = False # Used for Python 3.4 and later
- _tb_logger = None # Used for Python 3.3 only
+ _log_traceback = False
def __init__(self, *, loop=None):
"""Initialize the future.
@@ -240,9 +239,6 @@ def result(self):
if self._state != _FINISHED:
raise InvalidStateError('Result is not ready.')
self._log_traceback = False
- if self._tb_logger is not None:
- self._tb_logger.clear()
- self._tb_logger = None
if self._exception is not None:
raise self._exception
return self._result
@@ -260,9 +256,6 @@ def exception(self):
if self._state != _FINISHED:
raise InvalidStateError('Exception is not set.')
self._log_traceback = False
- if self._tb_logger is not None:
- self._tb_logger.clear()
- self._tb_logger = None
return self._exception
def add_done_callback(self, fn):
More information about the Python-checkins
mailing list