[3.13] gh-143547: Fix PyErr_FormatUnraisable() fallback (GH-143557) (GH-143603) (#143612)
[3.14] gh-143547: Fix PyErr_FormatUnraisable() fallback (GH-143557) (GH-143603)
gh-143547: Fix PyErr_FormatUnraisable() fallback (GH-143557)
Hold a strong reference to 'hook' while calling the default
unraisable took to log hook failure.
(cherry picked from commit
1d0baf1ae48f98b61cc869a82e1b7206298f653f)
(cherry picked from commit
39a2bcf949095bd603f7b73f15b5b478dbb49ba9)
Co-authored-by: Victor Stinner <vstinner@python.org>