[Python-checkins] r45299 - python/trunk/Objects/genobject.c

tim.peters python-checkins at python.org
Wed Apr 12 08:44:37 CEST 2006


Author: tim.peters
Date: Wed Apr 12 08:44:36 2006
New Revision: 45299

Modified:
   python/trunk/Objects/genobject.c
Log:
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.


Modified: python/trunk/Objects/genobject.c
==============================================================================
--- python/trunk/Objects/genobject.c	(original)
+++ python/trunk/Objects/genobject.c	Wed Apr 12 08:44:36 2006
@@ -217,10 +217,8 @@
 
 	/* 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");


More information about the Python-checkins mailing list