From: rialbat <47256826+rialbat@users.noreply.github.com> Date: Thu, 5 Jun 2025 15:08:48 +0000 (+0300) Subject: gh-135161: Remove redundant NULL check for 'exc' after dereference in ceval.c (#135162) X-Git-Tag: v3.15.0a1~1381 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8919cb4ad9fb18832a4bc9d5bbea305e9518c7ab;p=thirdparty%2FPython%2Fcpython.git gh-135161: Remove redundant NULL check for 'exc' after dereference in ceval.c (#135162) --- diff --git a/Python/ceval.c b/Python/ceval.c index 7aec196cb857..5ea837e1a6ef 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -3190,7 +3190,7 @@ _PyEval_FormatKwargsError(PyThreadState *tstate, PyObject *func, PyObject *kwarg else if (_PyErr_ExceptionMatches(tstate, PyExc_KeyError)) { PyObject *exc = _PyErr_GetRaisedException(tstate); PyObject *args = PyException_GetArgs(exc); - if (exc && PyTuple_Check(args) && PyTuple_GET_SIZE(args) == 1) { + if (PyTuple_Check(args) && PyTuple_GET_SIZE(args) == 1) { _PyErr_Clear(tstate); PyObject *funcstr = _PyObject_FunctionStr(func); if (funcstr != NULL) {