mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
GH-98543: Fix asyncio.TaskGroup
to not keep reference to errors after raising ExceptionGroup (#98544)
This commit is contained in:
parent
5871e19942
commit
f4a14941e6
1 changed files with 5 additions and 5 deletions
|
@ -128,11 +128,11 @@ class TaskGroup:
|
|||
# Exceptions are heavy objects that can have object
|
||||
# cycles (bad for GC); let's not keep a reference to
|
||||
# a bunch of them.
|
||||
errors = self._errors
|
||||
self._errors = None
|
||||
|
||||
me = BaseExceptionGroup('unhandled errors in a TaskGroup', errors)
|
||||
raise me from None
|
||||
try:
|
||||
me = BaseExceptionGroup('unhandled errors in a TaskGroup', self._errors)
|
||||
raise me from None
|
||||
finally:
|
||||
self._errors = None
|
||||
|
||||
def create_task(self, coro, *, name=None, context=None):
|
||||
if not self._entered:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue