From 003e8f00669d962693209e400358eb05469077a3 Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 15 Aug 2025 13:33:02 +1000 Subject: [PATCH] tests/net_inet/tls_num_errors.py: Make alloc of emg-exc-buf optional. The unix port doesn't have `micropython.alloc_emergency_exception_buf()` but it's still possible to run and pass this test. So make that call optional. Signed-off-by: Damien George --- tests/net_inet/tls_num_errors.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/net_inet/tls_num_errors.py b/tests/net_inet/tls_num_errors.py index 34aa2bb455134..9c12114eab1f6 100644 --- a/tests/net_inet/tls_num_errors.py +++ b/tests/net_inet/tls_num_errors.py @@ -3,15 +3,21 @@ import socket, ssl, sys try: - from micropython import alloc_emergency_exception_buf, heap_lock, heap_unlock + from micropython import heap_lock, heap_unlock except: print("SKIP") raise SystemExit +try: + from micropython import alloc_emergency_exception_buf + + alloc_emergency_exception_buf(256) +except: + pass + # test with heap locked to see it switch to number-only error message def test(addr): - alloc_emergency_exception_buf(256) s = socket.socket() s.connect(addr) try: