]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-135161: Remove redundant NULL check for 'exc' after dereference in ceval.c (#135162)
authorrialbat <47256826+rialbat@users.noreply.github.com>
Thu, 5 Jun 2025 15:08:48 +0000 (18:08 +0300)
committerGitHub <noreply@github.com>
Thu, 5 Jun 2025 15:08:48 +0000 (17:08 +0200)
Python/ceval.c

index 7aec196cb85704b83b1d76a081b59a80751d3ca4..5ea837e1a6ef3161e3fa28e587c28237f8185b28 100644 (file)
@@ -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) {