[Python-checkins] python/dist/src/Lib/test test_descr.py,1.143,1.144

rhettinger@users.sourceforge.net rhettinger@users.sourceforge.net
Mon, 24 Jun 2002 06:08:18 -0700


Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv21353/Lib/test

Modified Files:
	test_descr.py 
Log Message:
Fix SF bug 572567: Memory leak in object comparison.


Index: test_descr.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v
retrieving revision 1.143
retrieving revision 1.144
diff -C2 -d -r1.143 -r1.144
*** test_descr.py	20 Jun 2002 22:23:15 -0000	1.143
--- test_descr.py	24 Jun 2002 13:08:16 -0000	1.144
***************
*** 1164,1167 ****
--- 1164,1179 ----
      vereq(Counted.counter, 0)
  
+     # Test lookup leaks [SF bug 572567]
+     import sys,gc
+     class G(object):
+         def __cmp__(self, other):
+             return 0
+     g = G()
+     orig_objects = len(gc.get_objects())
+     for i in xrange(10):
+         g==g
+     new_objects = len(gc.get_objects())
+     vereq(orig_objects, new_objects)
+ 
  def dynamics():
      if verbose: print "Testing class attribute propagation..."