mirror of
https://github.com/python/cpython.git
synced 2025-09-30 04:15:43 +00:00
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 c16bacec3c
)
This commit is contained in:
parent
d5c71b0c98
commit
f54e405200
1 changed files with 1 additions and 8 deletions
|
@ -143,8 +143,7 @@ class Future:
|
||||||
# `yield Future()` (incorrect).
|
# `yield Future()` (incorrect).
|
||||||
_asyncio_future_blocking = False
|
_asyncio_future_blocking = False
|
||||||
|
|
||||||
_log_traceback = False # Used for Python 3.4 and later
|
_log_traceback = False
|
||||||
_tb_logger = None # Used for Python 3.3 only
|
|
||||||
|
|
||||||
def __init__(self, *, loop=None):
|
def __init__(self, *, loop=None):
|
||||||
"""Initialize the future.
|
"""Initialize the future.
|
||||||
|
@ -240,9 +239,6 @@ class Future:
|
||||||
if self._state != _FINISHED:
|
if self._state != _FINISHED:
|
||||||
raise InvalidStateError('Result is not ready.')
|
raise InvalidStateError('Result is not ready.')
|
||||||
self._log_traceback = False
|
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:
|
if self._exception is not None:
|
||||||
raise self._exception
|
raise self._exception
|
||||||
return self._result
|
return self._result
|
||||||
|
@ -260,9 +256,6 @@ class Future:
|
||||||
if self._state != _FINISHED:
|
if self._state != _FINISHED:
|
||||||
raise InvalidStateError('Exception is not set.')
|
raise InvalidStateError('Exception is not set.')
|
||||||
self._log_traceback = False
|
self._log_traceback = False
|
||||||
if self._tb_logger is not None:
|
|
||||||
self._tb_logger.clear()
|
|
||||||
self._tb_logger = None
|
|
||||||
return self._exception
|
return self._exception
|
||||||
|
|
||||||
def add_done_callback(self, fn):
|
def add_done_callback(self, fn):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue