From 06c176c2da4e3aa27abe6a6343064e3997b5b015 Mon Sep 17 00:00:00 2001 From: richardsheridan Date: Sat, 21 Oct 2023 12:42:39 -0400 Subject: [PATCH] prevent cyclic garbage creation --- trio/_core/_run.py | 1 + 1 file changed, 1 insertion(+) diff --git a/trio/_core/_run.py b/trio/_core/_run.py index 9c5bde76b7..64908eea33 100644 --- a/trio/_core/_run.py +++ b/trio/_core/_run.py @@ -1087,6 +1087,7 @@ def aborted(raise_cancel: _core.RaiseCancelT) -> Abort: exn = capture(raise_cancel).error if not isinstance(exn, Cancelled): self._add_exc(exn) + del exn # prevent cyclic garbage creation return Abort.FAILED self._parent_waiting_in_aexit = True