Skip to content

Commit

Permalink
Remove unused key in iteration of task dictionary (#2863)
Browse files Browse the repository at this point in the history
This comes from a flake8-bugbear warning.
  • Loading branch information
benclifford authored Aug 12, 2023
1 parent 976deea commit 063033a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions parsl/dataflow/dflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -1146,8 +1146,11 @@ def wait_for_current_tasks(self) -> None:

logger.info("Waiting for all remaining tasks to complete")

items = list(self.tasks.items())
for task_id, task_record in items:
# .values is made into a list immediately to reduce (although not
# eliminate) a race condition where self.tasks can be modified
# elsewhere by a completing task being removed from the dictionary.
task_records = list(self.tasks.values())
for task_record in task_records:
# .exception() is a less exception throwing way of
# waiting for completion than .result()
fut = task_record['app_fu']
Expand Down

0 comments on commit 063033a

Please sign in to comment.