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 d5dbbf4372.
This commit is contained in:
Kirill Podoprigora 2024-10-14 20:59:13 +03:00 committed by GitHub
parent 187580d95c
commit e99650b80a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 15 additions and 147 deletions

View file

@ -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