From b3d0f5f67ccabb57774b4cf677be1a4cfb36a39a Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 18 May 2022 09:16:33 +1000 Subject: [PATCH] tests/micropython: Fully unlink nested list in extreme exc test. To make sure there are no dangling references to the lists, and the GC can reclaim heap memory. Signed-off-by: Damien George --- tests/micropython/extreme_exc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/micropython/extreme_exc.py b/tests/micropython/extreme_exc.py index 9d2f24745..ad819e408 100644 --- a/tests/micropython/extreme_exc.py +++ b/tests/micropython/extreme_exc.py @@ -126,8 +126,8 @@ def main(): ) except Exception as er: e = er - lst[0][0] = None - lst = None + while lst: + lst[0], lst = None, lst[0] # unlink lists to free up heap print(repr(e)[:10]) # raise a deep exception with the heap locked