# test that emergency exceptions workimportmicropythonimportsys# some ports need to allocate heap for the emg exctry:micropython.alloc_emergency_exception_buf(256)exceptAttributeError:passdeff():micropython.heap_lock()try:raiseValueError(1)exceptValueErroraser:sys.print_exception(er)micropython.heap_unlock()f()