aboutsummaryrefslogtreecommitdiffhomepage
path: root/sec_certs/parallel_processing.py
diff options
context:
space:
mode:
authormmstanone2021-12-12 21:21:55 +0100
committermmstanone2021-12-12 21:21:55 +0100
commitb30e3884fe33089f46c10366c41af2e0b0c83ca3 (patch)
tree3f7a41b3c42d52335e54186263130eba570d94e3 /sec_certs/parallel_processing.py
parent919b995cc3fabb3d1fdbe3e5847b5e81eb2de5c8 (diff)
parent5e43b370c9ee027ebda736fe25caa8e65979e693 (diff)
downloadsec-certs-b30e3884fe33089f46c10366c41af2e0b0c83ca3.tar.gz
sec-certs-b30e3884fe33089f46c10366c41af2e0b0c83ca3.tar.zst
sec-certs-b30e3884fe33089f46c10366c41af2e0b0c83ca3.zip
Merge branch 'dev' into mypy-errors
Diffstat (limited to 'sec_certs/parallel_processing.py')
-rw-r--r--sec_certs/parallel_processing.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/sec_certs/parallel_processing.py b/sec_certs/parallel_processing.py
index 3b91f652..c0a4ea63 100644
--- a/sec_certs/parallel_processing.py
+++ b/sec_certs/parallel_processing.py
@@ -13,10 +13,7 @@ def process_parallel(func: Callable, items: Iterable, max_workers: int, callback
else:
pool = Pool(max_workers)
- if unpack is False:
- results = [pool.apply_async(func, (i, ), callback=callback) for i in items]
- else:
- results = [pool.apply_async(func, (*i, ), callback=callback) for i in items]
+ results = [pool.apply_async(func, (*i,), callback=callback) for i in items] if unpack else [pool.apply_async(func, (i, ), callback=callback) for i in items]
if progress_bar is True and items:
bar = tqdm(total=len(results), desc=progress_bar_desc)