From 19d43a3e6fb4cb8ea11747d7d7bca7a3542fbb44 Mon Sep 17 00:00:00 2001 From: shadchin Date: Sat, 7 Feb 2026 19:56:35 +0300 Subject: Update Python 3 to 3.13.12 commit_hash:71d3efea437a769b2b7910d196120bb02587046e --- contrib/tools/python3/Python/errors.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'contrib/tools/python3/Python/errors.c') diff --git a/contrib/tools/python3/Python/errors.c b/contrib/tools/python3/Python/errors.c index 63e4844b1c0..b565722ef56 100644 --- a/contrib/tools/python3/Python/errors.c +++ b/contrib/tools/python3/Python/errors.c @@ -1598,6 +1598,7 @@ format_unraisable_v(const char *format, va_list va, PyObject *obj) _Py_EnsureTstateNotNULL(tstate); PyObject *err_msg = NULL; + PyObject *hook = NULL; PyObject *exc_type, *exc_value, *exc_tb; _PyErr_Fetch(tstate, &exc_type, &exc_value, &exc_tb); @@ -1642,7 +1643,6 @@ format_unraisable_v(const char *format, va_list va, PyObject *obj) goto error; } - PyObject *hook; if (_PySys_GetOptionalAttr(&_Py_ID(unraisablehook), &hook) < 0) { Py_DECREF(hook_args); err_msg_str = NULL; @@ -1655,7 +1655,6 @@ format_unraisable_v(const char *format, va_list va, PyObject *obj) } if (_PySys_Audit(tstate, "sys.unraisablehook", "OO", hook, hook_args) < 0) { - Py_DECREF(hook); Py_DECREF(hook_args); err_msg_str = "Exception ignored in audit hook"; obj = NULL; @@ -1663,13 +1662,11 @@ format_unraisable_v(const char *format, va_list va, PyObject *obj) } if (hook == Py_None) { - Py_DECREF(hook); Py_DECREF(hook_args); goto default_hook; } PyObject *res = PyObject_CallOneArg(hook, hook_args); - Py_DECREF(hook); Py_DECREF(hook_args); if (res != NULL) { Py_DECREF(res); @@ -1699,6 +1696,7 @@ done: Py_XDECREF(exc_value); Py_XDECREF(exc_tb); Py_XDECREF(err_msg); + Py_XDECREF(hook); _PyErr_Clear(tstate); /* Just in case */ } -- cgit v1.3