On Python 3.13, you can call sys._current_exceptions() in C which wraps the internal _PyThread_CurrentExceptions() function. Tell me if you need help to write code to call the function. It works on Python 3.12 and older: see sys._current_exceptions() documentation.
So I was wondering whether it is expected that
_PyThread_CurrentExceptionsis no longer available from symbols, whilst_PyThread_CurrentFramesstill is.
mod_wsgi uses _PyThread_CurrentFrames() which triggered to restore the function in Python 3.13 alpha 2: