From 3f0933668439a03d6b4e174848ad7ea8a96f2cdc Mon Sep 17 00:00:00 2001 From: Adam Janovsky Date: Wed, 15 Dec 2021 10:04:02 +0100 Subject: fix import error parallel processing --- sec_certs/parallel_processing.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sec_certs/parallel_processing.py') 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: -- cgit v1.3.1