From 3de280de0b9854f16228004c3b7604a27426a214 Mon Sep 17 00:00:00 2001 From: Rialbat Date: Thu, 5 Jun 2025 10:12:13 +0300 Subject: [PATCH] gh-135161: Remove redundant NULL check for 'exc' after dereference in ceval.c --- Python/ceval.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Python/ceval.c b/Python/ceval.c index 7aec196cb85704..5ea837e1a6ef31 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) {