From b78fac161e34eb953c499eb17630e67355a9508a Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 10 Dec 2025 12:39:01 +1100 Subject: tests/ports/esp32/check_err_str.py: Preallocate global variable. This test fails on all esp32 boards without this fix, because the try/except that runs with the heap locked attempts to increase the size of the globals dict when assigning to the exception variable `e`. Fix that by preallocating the global variable `e`. Signed-off-by: Damien George --- tests/ports/esp32/check_err_str.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/ports/esp32/check_err_str.py b/tests/ports/esp32/check_err_str.py index 055eecf74..9efe1afa1 100644 --- a/tests/ports/esp32/check_err_str.py +++ b/tests/ports/esp32/check_err_str.py @@ -1,3 +1,5 @@ +# This tests checks the behaviour of the `check_esp_err`/`check_esp_err_` C function. + try: from esp32 import Partition as p import micropython @@ -23,6 +25,7 @@ except OSError as e: # same but with out of memory condition by locking the heap exc = "FAILED TO RAISE" +e = None # preallocate entry in globals dict micropython.heap_lock() try: fun(part) @@ -34,6 +37,7 @@ print("exc:", exc) # exc empty due to no memory # same again but having an emergency buffer micropython.alloc_emergency_exception_buf(256) exc = "FAILED TO RAISE" +e = None # preallocate entry in globals dict micropython.heap_lock() try: fun(part) -- cgit v1.2.3