8000 Fix test · python/cpython@b69e803 · GitHub
[go: up one dir, main page]

Skip to content

Commit b69e803

Browse files
committed
Fix test
1 parent f56451b commit b69e803

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Lib/test/test_generators.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ def gen():
182182
yield 1
183183

184184
thresholds = gc.get_threshold()
185+
185186
gc.callbacks.append(cb)
186187
gc.set_threshold(1, 0, 0)
187188
try:
@@ -197,11 +198,14 @@ def __del__(self):
197198
sneaky = Sneaky()
198199
sneaky._s = Sneaky()
199200
sneaky._s._s = sneaky
200-
del sneaky
201201

202202
gc.set_threshold(1, 0, 0)
203203
try:
204-
gen()
204+
del sneaky
205+
try:
206+
gen()
207+
except KeyboardInterrupt:
208+
pass
205209
finally:
206210
gc.set_threshold(*thresholds)
207211

0 commit comments

Comments
 (0)
0