[3.7] bpo-20526: Fix PyThreadState_Clear(): don't decref frame (GH-19120) (GH-19136) by vstinner · Pull Request #19137 · python/cpython (original) (raw)
PyThreadState.frame is a borrowed reference, not a strong reference:
PyThreadState_Clear() must not call Py_CLEAR(tstate->frame).
Remove test_threading.test_warnings_at_exit(): we cannot warranty
that the Python thread state of daemon threads is cleared in a
reliable way during Python shutdown.
(cherry picked from commit 5804f87)
(cherry picked from commit e97c8b0)