From fe22e0985adae5ccfe230c815267fd410de59148 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 4 Dec 2014 23:00:13 +0100 Subject: asyncio: Initialize more Future and Task attributes in the class definition to avoid attribute errors in destructors. --- Lib/asyncio/futures.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'Lib/asyncio/futures.py') diff --git a/Lib/asyncio/futures.py b/Lib/asyncio/futures.py index 19e79189dc..f46d008f08 100644 --- a/Lib/asyncio/futures.py +++ b/Lib/asyncio/futures.py @@ -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 -- cgit v1.2.1