[Patches] [ python-Patches-486743 ] remove bad INCREF, propagate exception

noreply@sourceforge.net noreply@sourceforge.net
Wed, 28 Nov 2001 15:11:47 -0800


Patches item #486743, was opened at 2001-11-28 15:11
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=486743&group_id=5470

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Zooko Ozoko (zooko)
Assigned to: Nobody/Anonymous (nobody)
Summary: remove bad INCREF, propagate exception

Initial Comment:
This is my very first foray into the Python
interpreter, so please be patient.  It looks like to me
that this INCREF is wrong since the PyList_Append()
will steal the reference.  Also I tested it.  Current
CVS does this:

>>> import gc
>>> len(gc.get_objects())
1559
>>> len(gc.get_objects())
1562
>>> len(gc.get_objects())
1565
>>> len(gc.get_objects())
1568
>>> len(gc.get_objects())
1571
>>> len(gc.get_objects())
1574

and with my patch it does this:

>>> import gc
>>> len(gc.get_objects())
1559
>>> len(gc.get_objects())
1559
>>> len(gc.get_objects())
1559
>>> len(gc.get_objects())
1559
>>> len(gc.get_objects())
1559
>>> len(gc.get_objects())
1559
>>> len(gc.get_objects())
1559


In addition I added checks for error return from
PyList_Append(), and propagated the exception condition
up the callstack.


----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=486743&group_id=5470