We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 268927d commit de09affCopy full SHA for de09aff
Lib/concurrent/futures/_base.py
@@ -627,14 +627,13 @@ def result_iterator():
627
try:
628
# reverse to keep finishing order
629
fs.reverse()
630
- current_timeout = timeout
+ # Careful not to keep a reference to the popped future or its result
631
while fs:
632
- # Careful not to keep a reference to the popped future or its result
633
- if current_timeout is not None:
634
- current_timeout = end_time - time.monotonic()
635
-
636
# wait for the next result
637
- _result_or_cancel(fs[-1], current_timeout)
+ if timeout is None:
+ _result_or_cancel(fs[-1])
+ else:
+ _result_or_cancel(fs[-1], end_time - time.monotonic())
638
639
# buffer next task
640
if (
0 commit comments