Kaydet (Commit) ec766d3c authored tarafından Berker Peksag's avatar Berker Peksag

Issue #23960: Cleanup args and kwargs on error in PyErr_SetImportError

Patch by Ofer Schwarz.
üst 8988ebf2
......@@ -727,9 +727,9 @@ PyErr_SetImportError(PyObject *msg, PyObject *name, PyObject *path)
PyTuple_SET_ITEM(args, 0, msg);
if (PyDict_SetItemString(kwargs, "name", name) < 0)
return NULL;
goto done;
if (PyDict_SetItemString(kwargs, "path", path) < 0)
return NULL;
goto done;
error = PyObject_Call(PyExc_ImportError, args, kwargs);
if (error != NULL) {
......@@ -737,9 +737,9 @@ PyErr_SetImportError(PyObject *msg, PyObject *name, PyObject *path)
Py_DECREF(error);
}
done:
Py_DECREF(args);
Py_DECREF(kwargs);
return NULL;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment