diff options
| author | Adam Janovsky | 2021-12-15 10:04:02 +0100 |
|---|---|---|
| committer | Adam Janovsky | 2021-12-15 10:04:02 +0100 |
| commit | 3f0933668439a03d6b4e174848ad7ea8a96f2cdc (patch) | |
| tree | 612f67a860c1d0a19f170b747e598d52d6657ca4 /sec_certs/parallel_processing.py | |
| parent | 94414e8e040e162883d1d0182a198ca1533cd42c (diff) | |
| download | sec-certs-3f0933668439a03d6b4e174848ad7ea8a96f2cdc.tar.gz sec-certs-3f0933668439a03d6b4e174848ad7ea8a96f2cdc.tar.zst sec-certs-3f0933668439a03d6b4e174848ad7ea8a96f2cdc.zip | |
fix import error parallel processing
Diffstat (limited to 'sec_certs/parallel_processing.py')
| -rw-r--r-- | sec_certs/parallel_processing.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sec_certs/parallel_processing.py b/sec_certs/parallel_processing.py index 0e2ac175..912ef73b 100644 --- a/sec_certs/parallel_processing.py +++ b/sec_certs/parallel_processing.py @@ -1,6 +1,6 @@ from sec_certs.helpers import tqdm from concurrent.futures import ProcessPoolExecutor as ProcessPool, ThreadPoolExecutor as ThreadPool -from typing import Callable, Iterable, Optional +from typing import Callable, Iterable, Optional, Union import time @@ -8,7 +8,7 @@ def process_parallel(func: Callable, items: Iterable, max_workers: int, use_threading: bool = True, progress_bar: bool = True, unpack: bool = False, progress_bar_desc: Optional[str] = None): - pool: Union[Pool, ThreadPool] = ThreadPool(max_workers) if use_threading else Pool(max_workers) + pool: Union[ProcessPool, ThreadPool] = ThreadPool(max_workers) if use_threading else ProcessPool(max_workers) results = [pool.submit(func, *i) for i in items] if unpack else [pool.submit(func, i) for i in items] if progress_bar is True and items: |
