Skip to content

Commit de09aff

Browse files
committed
remove current_timeout usage
1 parent 268927d commit de09aff

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

Lib/concurrent/futures/_base.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -627,14 +627,13 @@ def result_iterator():
627627
try:
628628
# reverse to keep finishing order
629629
fs.reverse()
630-
current_timeout = timeout
630+
# Careful not to keep a reference to the popped future or its result
631631
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-
636632
# wait for the next result
637-
_result_or_cancel(fs[-1], current_timeout)
633+
if timeout is None:
634+
_result_or_cancel(fs[-1])
635+
else:
636+
_result_or_cancel(fs[-1], end_time - time.monotonic())
638637

639638
# buffer next task
640639
if (

0 commit comments

Comments
 (0)