Kaydet (Commit) a5a80cb4 authored tarafından Tim Peters's avatar Tim Peters

gen_throw(): The caller doesn't own PyArg_ParseTuple()

"O" arguments, so must not decref them.  This accounts
for why running test_contextlib.test_main() in a loop
eventually tried to deallocate Py_None.
üst ee6d23e5
...@@ -217,10 +217,8 @@ gen_throw(PyGenObject *gen, PyObject *args) ...@@ -217,10 +217,8 @@ gen_throw(PyGenObject *gen, PyObject *args)
/* First, check the traceback argument, replacing None with /* First, check the traceback argument, replacing None with
NULL. */ NULL. */
if (tb == Py_None) { if (tb == Py_None)
Py_DECREF(tb);
tb = NULL; tb = NULL;
}
else if (tb != NULL && !PyTraceBack_Check(tb)) { else if (tb != NULL && !PyTraceBack_Check(tb)) {
PyErr_SetString(PyExc_TypeError, PyErr_SetString(PyExc_TypeError,
"throw() third argument must be a traceback object"); "throw() third argument must be a traceback object");
......
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