ruff: Fix SIM113 Use enumerate() for index variable in for loop.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2024-02-01 16:38:52 -08:00
committed by Tim Abbott
parent f165ba0fb3
commit 53e80c41ea
6 changed files with 12 additions and 34 deletions

View File

@@ -634,12 +634,10 @@ def run_parallel_wrapper(
logging.info("Distributing %s items across %s threads", len(full_items), threads)
with ProcessPoolExecutor(max_workers=threads) as executor:
count = 0
for future in as_completed(
executor.submit(wrapping_function, f, item) for item in full_items
for count, future in enumerate(
as_completed(executor.submit(wrapping_function, f, item) for item in full_items), 1
):
future.result()
count += 1
if count % 1000 == 0:
logging.info("Finished %s items", count)