aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/asyncio/futures.py
diff options
context:
space:
mode:
authorKirill Podoprigora <kirill.bast9@mail.ru>2024-10-14 20:59:13 +0300
committerGitHub <noreply@github.com>2024-10-14 17:59:13 +0000
commite99650b80ace3893c2a80b3f2a4aca99cb305191 (patch)
tree40ffbb74761cee6d4f4a6ef5755539ed92ff299e /Lib/asyncio/futures.py
parent187580d95c8339a3b6e2b012f98d86101c346cfa (diff)
downloadcpython-e99650b80ace3893c2a80b3f2a4aca99cb305191.tar.gz
cpython-e99650b80ace3893c2a80b3f2a4aca99cb305191.zip
gh-125472: Revert "gh-124958: fix asyncio.TaskGroup and _PyFuture refcycles (#12… (#125476)
Revert "gh-124958: fix asyncio.TaskGroup and _PyFuture refcycles (#124959)" This reverts commit d5dbbf4372cd3dbf3eead1cc70ddc4261c061fd9.
Diffstat (limited to 'Lib/asyncio/futures.py')
-rw-r--r--Lib/asyncio/futures.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/asyncio/futures.py b/Lib/asyncio/futures.py
index c95fce035cd..5f6fa234872 100644
--- a/Lib/asyncio/futures.py
+++ b/Lib/asyncio/futures.py
@@ -190,7 +190,8 @@ class Future:
the future is done and has an exception set, this exception is raised.
"""
if self._state == _CANCELLED:
- raise self._make_cancelled_error()
+ exc = self._make_cancelled_error()
+ raise exc
if self._state != _FINISHED:
raise exceptions.InvalidStateError('Result is not ready.')
self.__log_traceback = False
@@ -207,7 +208,8 @@ class Future:
InvalidStateError.
"""
if self._state == _CANCELLED:
- raise self._make_cancelled_error()
+ exc = self._make_cancelled_error()
+ raise exc
if self._state != _FINISHED:
raise exceptions.InvalidStateError('Exception is not set.')
self.__log_traceback = False