mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
gh-124958: fix asyncio.TaskGroup and _PyFuture refcycles (#124959)
This commit is contained in:
parent
45df264f3f
commit
d5dbbf4372
5 changed files with 147 additions and 15 deletions
|
@ -190,8 +190,7 @@ class Future:
|
|||
the future is done and has an exception set, this exception is raised.
|
||||
"""
|
||||
if self._state == _CANCELLED:
|
||||
exc = self._make_cancelled_error()
|
||||
raise exc
|
||||
raise self._make_cancelled_error()
|
||||
if self._state != _FINISHED:
|
||||
raise exceptions.InvalidStateError('Result is not ready.')
|
||||
self.__log_traceback = False
|
||||
|
@ -208,8 +207,7 @@ class Future:
|
|||
InvalidStateError.
|
||||
"""
|
||||
if self._state == _CANCELLED:
|
||||
exc = self._make_cancelled_error()
|
||||
raise exc
|
||||
raise self._make_cancelled_error()
|
||||
if self._state != _FINISHED:
|
||||
raise exceptions.InvalidStateError('Exception is not set.')
|
||||
self.__log_traceback = False
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue