src/eric7/CodeFormatting/BlackFormattingDialog.py

branch
eric7
changeset 9292
a5c8a0213fe3
parent 9289
ba49c41e8f63
child 9344
52990830b13f
equal deleted inserted replaced
9291:7b271bcd12d0 9292:a5c8a0213fe3
272 taskQueue = multiprocessing.Queue() 272 taskQueue = multiprocessing.Queue()
273 doneQueue = multiprocessing.Queue() 273 doneQueue = multiprocessing.Queue()
274 274
275 # Submit tasks (initially two times the number of processes) 275 # Submit tasks (initially two times the number of processes)
276 tasks = len(files) 276 tasks = len(files)
277 initialTasks = 2 * NumberOfProcesses 277 initialTasks = min(2 * NumberOfProcesses, tasks)
278 for _ in range(initialTasks): 278 for _ in range(initialTasks):
279 file = files.pop(0) 279 file = files.pop(0)
280 relSrc = self.__project.getRelativePath(str(file)) if self.__project else "" 280 relSrc = self.__project.getRelativePath(str(file)) if self.__project else ""
281 taskQueue.put((file, relSrc)) 281 taskQueue.put((file, relSrc))
282 282

eric ide

mercurial