mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Fix SF bug 572567: Memory leak in object comparison.
This commit is contained in:
parent
563d12d145
commit
ab5dae35ca
3 changed files with 14 additions and 0 deletions
|
@ -1163,6 +1163,18 @@ def slots():
|
|||
gc.collect()
|
||||
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..."
|
||||
class D(object):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue