cpython: 94471357db08 (original) (raw)

Mercurial > cpython

changeset 101196:94471357db08

Issue #23960: Cleanup args and kwargs on error in PyErr_SetImportError Patch by Ofer Schwarz. [#23960]

Berker Peksag berker.peksag@gmail.com
date Sun, 01 May 2016 09:06:57 +0300
parents 5b5fbce1db9c(current diff)5871b48f4c2e(diff)
children 634764b4675c
files
diffstat 1 files changed, 3 insertions(+), 3 deletions(-)[+] [-] Python/errors.c 6

line wrap: on

line diff

--- a/Python/errors.c +++ b/Python/errors.c @@ -727,9 +727,9 @@ PyErr_SetImportError(PyObject *msg, PyOb PyTuple_SET_ITEM(args, 0, msg); if (PyDict_SetItemString(kwargs, "name", name) < 0)

error = PyObject_Call(PyExc_ImportError, args, kwargs); if (error != NULL) { @@ -737,9 +737,9 @@ PyErr_SetImportError(PyObject *msg, PyOb Py_DECREF(error); } +done: Py_DECREF(args); Py_DECREF(kwargs); - return NULL; }