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.
This commit is contained in:
Tim Peters 2006-04-12 06:44:36 +00:00
parent ee6d23e500
commit a5a80cb4a4
1 changed files with 1 additions and 3 deletions

View File

@ -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");