gh-135161: Remove redundant NULL check for 'exc' after dereference in ceval.c (#135162)

This commit is contained in:
rialbat
2025-06-05 18:08:48 +03:00
committed by GitHub
parent 9258f3da91
commit 8919cb4ad9

View 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) {