summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2006-04-12 06:44:36 (GMT)
committerTim Peters <tim.peters@gmail.com>2006-04-12 06:44:36 (GMT)
commita5a80cb4a46b031641f56493dbf4821d4f3560b0 (patch)
tree340f580f9ed63af63e97385ab142260dd865c187
parentee6d23e500c456d6cd34dd8be9aac5cac62d81a7 (diff)
downloadcpython-a5a80cb4a46b031641f56493dbf4821d4f3560b0.zip
cpython-a5a80cb4a46b031641f56493dbf4821d4f3560b0.tar.gz
cpython-a5a80cb4a46b031641f56493dbf4821d4f3560b0.tar.bz2
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.
-rw-r--r--Objects/genobject.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/Objects/genobject.c b/Objects/genobject.c
index a3eae6a..7cec290 100644
--- a/Objects/genobject.c
+++ b/Objects/genobject.c
@@ -217,10 +217,8 @@ gen_throw(PyGenObject *gen, PyObject *args)
/* First, check the traceback argument, replacing None with
NULL. */
- if (tb == Py_None) {
- Py_DECREF(tb);
+ if (tb == Py_None)
tb = NULL;
- }
else if (tb != NULL && !PyTraceBack_Check(tb)) {
PyErr_SetString(PyExc_TypeError,
"throw() third argument must be a traceback object");