--- a/src/eric7/Plugins/CheckerPlugins/SyntaxChecker/jsonCheckSyntax.py Tue Aug 16 13:14:42 2022 +0200 +++ b/src/eric7/Plugins/CheckerPlugins/SyntaxChecker/jsonCheckSyntax.py Tue Aug 16 19:07:16 2022 +0200 @@ -95,10 +95,11 @@ taskQueue = multiprocessing.Queue() doneQueue = multiprocessing.Queue() - # Submit tasks (initially two time number of processes + # Submit tasks (initially two times the number of processes) + tasks = len(argumentsList) initialTasks = 2 * NumberOfProcesses - for task in argumentsList[:initialTasks]: - taskQueue.put(task) + for _ in range(initialTasks): + taskQueue.put(argumentsList.pop(0)) # Start worker processes workers = [ @@ -109,8 +110,7 @@ worker.start() # Get and send results - endIndex = len(argumentsList) - initialTasks - for i in range(len(argumentsList)): + for _ in range(tasks): resultSent = False wasCancelled = False @@ -130,8 +130,8 @@ # just exit the loop ignoring the results of queued tasks break - if i < endIndex: - taskQueue.put(argumentsList[i + initialTasks]) + if argumentsList: + taskQueue.put(argumentsList.pop(0)) # Tell child processes to stop for _ in range(NumberOfProcesses):