gh-145376: Fix various reference leaks (GH-145377)

This commit is contained in:
Jelle Zijlstra 2026-03-03 07:23:30 -08:00 committed by GitHub
parent 246227392c
commit bd13cc09fa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 6 additions and 1 deletions

View file

@ -1145,6 +1145,7 @@ _PyErr_Display(PyObject *file, PyObject *unused, PyObject *value, PyObject *tb)
"traceback",
"_print_exception_bltin");
if (print_exception_fn == NULL || !PyCallable_Check(print_exception_fn)) {
Py_XDECREF(print_exception_fn);
goto fallback;
}