Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove current_timeout usage
  • Loading branch information
ebonnal committed Mar 20, 2025
commit de09affe5d6e00d6e4ab6c3b0d7bdd5d2c4be1f2
11 changes: 5 additions & 6 deletions Lib/concurrent/futures/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -627,14 +627,13 @@ def result_iterator():
try:
# reverse to keep finishing order
fs.reverse()
current_timeout = timeout
# Careful not to keep a reference to the popped future or its result
while fs:
# Careful not to keep a reference to the popped future or its result
if current_timeout is not None:
current_timeout = end_time - time.monotonic()

# wait for the next result
_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())

# buffer next task
if (
Expand Down
Loading