summaryrefslogtreecommitdiff
path: root/tests/micropython/extreme_exc.py
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2022-05-18 09:16:33 +1000
committerDamien George <damien@micropython.org>2022-05-18 09:16:33 +1000
commitb3d0f5f67ccabb57774b4cf677be1a4cfb36a39a (patch)
tree59f489cc85c403b1efa0a04c28abf0c137d44f0b /tests/micropython/extreme_exc.py
parent90682f43af4867d508609c0f521fada81935fcf7 (diff)
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 <damien@micropython.org>
Diffstat (limited to 'tests/micropython/extreme_exc.py')
-rw-r--r--tests/micropython/extreme_exc.py4
1 files 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