File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -174,21 +174,19 @@ def test_saveall():
174174 gc .collect ()
175175 vereq (gc .garbage , []) # if this fails, someone else created immortal trash
176176
177- l = []
178- l .append (l )
179- id_l = id (l )
177+ L = []
178+ L .append (L )
179+ id_L = id (L )
180180
181181 debug = gc .get_debug ()
182182 gc .set_debug (debug | gc .DEBUG_SAVEALL )
183- del l
183+ del L
184184 gc .collect ()
185185 gc .set_debug (debug )
186186
187187 vereq (len (gc .garbage ), 1 )
188- if id (gc .garbage [0 ]) == id_l :
189- del gc .garbage [0 ]
190- else :
191- raise TestFailed , "didn't find obj in garbage (saveall)"
188+ obj = gc .garbage .pop ()
189+ vereq (id (obj ), id_L )
192190
193191def test_del ():
194192 # __del__ methods can trigger collection, make this to happen
@@ -203,7 +201,7 @@ def __del__(self):
203201 del a
204202
205203 gc .disable ()
206- apply ( gc .set_threshold , thresholds )
204+ gc .set_threshold ( * thresholds )
207205
208206def test_del_newclass ():
209207 # __del__ methods can trigger collection, make this to happen
@@ -218,7 +216,7 @@ def __del__(self):
218216 del a
219217
220218 gc .disable ()
221- apply ( gc .set_threshold , thresholds )
219+ gc .set_threshold ( * thresholds )
222220
223221class Ouch :
224222 n = 0
You can’t perform that action at this time.
0 commit comments