mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
asyncio: Initialize more Future and Task attributes in the class definition to
avoid attribute errors in destructors.
This commit is contained in:
parent
bb37b4ca73
commit
fe22e0985a
2 changed files with 5 additions and 5 deletions
|
@ -135,6 +135,7 @@ class Future:
|
|||
_result = None
|
||||
_exception = None
|
||||
_loop = None
|
||||
_source_traceback = None
|
||||
|
||||
_blocking = False # proper use of future (yield vs yield from)
|
||||
|
||||
|
@ -155,8 +156,6 @@ class Future:
|
|||
self._callbacks = []
|
||||
if self._loop.get_debug():
|
||||
self._source_traceback = traceback.extract_stack(sys._getframe(1))
|
||||
else:
|
||||
self._source_traceback = None
|
||||
|
||||
def _format_callbacks(self):
|
||||
cb = self._callbacks
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue