Kaydet (Commit) 9c5b5154 authored tarafından Georg Brandl's avatar Georg Brandl

Fix a refleak in the _warnings module.

üst 18eb1fa2
......@@ -408,8 +408,10 @@ warn_explicit(PyObject *category, PyObject *message,
/* A proper implementation of warnings.showwarning() should
have at least two default arguments. */
if ((defaults == NULL) || (PyTuple_Size(defaults) < 2)) {
if (PyErr_WarnEx(PyExc_DeprecationWarning, msg, 1) < 0)
if (PyErr_WarnEx(PyExc_DeprecationWarning, msg, 1) < 0) {
Py_DECREF(show_fxn);
goto cleanup;
}
}
res = PyObject_CallFunctionObjArgs(show_fxn, message, category,
filename, lineno_obj,
......
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