summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_gc.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_gc.py')
-rw-r--r--Lib/test/test_gc.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/Lib/test/test_gc.py b/Lib/test/test_gc.py
index 46448ba..2e1bc11 100644
--- a/Lib/test/test_gc.py
+++ b/Lib/test/test_gc.py
@@ -180,16 +180,14 @@ def test_saveall():
l.append(l)
id_l = id(l)
del l
+
gc.collect()
- vereq(len(gc.garbage), 1)
try:
- for obj in gc.garbage:
- if id(obj) == id_l:
- del obj[:]
- break
+ vereq(len(gc.garbage), 1)
+ if id(gc.garbage[0]) == id_l:
+ del gc.garbage[0]
else:
raise TestFailed, "didn't find obj in garbage (saveall)"
- gc.garbage.remove(obj)
finally:
gc.set_debug(debug)