You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Warn In PyThreadState_Clear() If the Thread State Still Has an Unhandled Exception #121058
When PyThreadState_Clear() is called, the thread state could still have an exception set. As a user, it would be helpful to know when that happens. This is similar to how we already warn the user if the thread state was still running Python code (we check tstate->current_frame).
For unhandled exceptions, I'm pretty sure we'd check tstate->exc_state (or maybe tstate->exc_info), along with tstate->current_exception. We could emit a warning, as well as print the traceback (or generally invoke sys.excepthook()).
It would probably make sense to separately warn about tstate->async_exc (and print that traceback).
Activity
gh-121058: Warn if `PyThreadState_Clear` is called with an exception …
pythongh-121058: Warn if `PyThreadState_Clear` is called with an exce…