Skip to content

Commit 7337829

Browse files
Fix empty range in terminate_pool_with_backoff making it a no-op
range(number_of_trials, 1) with number_of_trials=3 produces an empty range since the default step is +1 and 3 > 1. The retry loop body never executed, so on Windows pool termination with backoff never happened. Fix by using range(number_of_trials) to iterate correctly. Signed-off-by: codewithfourtix <codewithfourtix@gmail.com>
1 parent d320c97 commit 7337829

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/scancode/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1390,7 +1390,7 @@ def terminate_pool(pool):
13901390

13911391
def terminate_pool_with_backoff(pool, number_of_trials=3):
13921392
# try a few times to terminate,
1393-
for trial in range(number_of_trials, 1):
1393+
for trial in range(number_of_trials):
13941394
try:
13951395
pool.terminate()
13961396
break

0 commit comments

Comments
 (0)