Skip to content

Commit b3d0f5f

Browse files
committed
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>
1 parent 90682f4 commit b3d0f5f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tests/micropython/extreme_exc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ def f():
126126
)
127127
except Exception as er:
128128
e = er
129-
lst[0][0] = None
130-
lst = None
129+
while lst:
130+
lst[0], lst = None, lst[0] # unlink lists to free up heap
131131
print(repr(e)[:10])
132132

133133
# raise a deep exception with the heap locked

0 commit comments

Comments
 (0)