1 parent f509097 commit d50dabdCopy full SHA for d50dabd
1 file changed
Lib/concurrent/futures/_base.py
@@ -633,11 +633,12 @@ def result_iterator():
633
634
# yield the awaited result
635
yield fs.pop()._result
636
- except:
637
- # break the reference cycle with fs[-1]._exception's traceback
638
- fs.pop().cancel()
639
- raise
+
640
finally:
+ # break the reference cycle with fs[-1]._exception's traceback
+ if fs:
+ fs.pop().cancel()
641
642
for future in fs:
643
future.cancel()
644
0 commit comments