We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c648d46 commit cf0b32cCopy full SHA for cf0b32c
Lib/test/test_generators.py
@@ -193,7 +193,10 @@ def gen():
193
194
class Sneaky:
195
def __del__(self):
196
- raise KeyboardInterrupt
+ try:
197
+ raise KeyboardInterrupt
198
+ except:
199
+ pass
200
201
sneaky = Sneaky()
202
sneaky._s = Sneaky()
@@ -202,10 +205,7 @@ def __del__(self):
205
gc.set_threshold(1, 0, 0)
203
206
try:
204
207
del sneaky
- try:
- gen()
- except KeyboardInterrupt:
208
- pass
+ gen()
209
finally:
210
gc.set_threshold(*thresholds)
211
0 commit comments