Skip to content
Snippets Groups Projects
Unverified Commit f4a14941 authored by Kumar Aditya's avatar Kumar Aditya Committed by GitHub
Browse files

GH-98543: Fix `asyncio.TaskGroup` to not keep reference to errors after...

GH-98543: Fix `asyncio.TaskGroup`  to not keep reference to errors after raising ExceptionGroup  (#98544)
parent 5871e199
Branches
Tags
No related merge requests found
...@@ -128,11 +128,11 @@ async def __aexit__(self, et, exc, tb): ...@@ -128,11 +128,11 @@ async def __aexit__(self, et, exc, tb):
# Exceptions are heavy objects that can have object # Exceptions are heavy objects that can have object
# cycles (bad for GC); let's not keep a reference to # cycles (bad for GC); let's not keep a reference to
# a bunch of them. # a bunch of them.
errors = self._errors try:
self._errors = None me = BaseExceptionGroup('unhandled errors in a TaskGroup', self._errors)
me = BaseExceptionGroup('unhandled errors in a TaskGroup', errors)
raise me from None raise me from None
finally:
self._errors = None
def create_task(self, coro, *, name=None, context=None): def create_task(self, coro, *, name=None, context=None):
if not self._entered: if not self._entered:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment