Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: use ThreadPoolExecutor instead of ThreadPool #21141

Merged
merged 1 commit into from Mar 3, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 3 additions & 4 deletions numpy/distutils/ccompiler.py
Expand Up @@ -355,10 +355,9 @@ def single_compile(args):

if len(build) > 1 and jobs > 1:
# build parallel
import multiprocessing.pool
pool = multiprocessing.pool.ThreadPool(jobs)
pool.map(single_compile, build_items)
pool.close()
from concurrent.futures import ThreadPoolExecutor
with ThreadPoolExecutor(jobs) as pool:
pool.map(single_compile, build_items)
else:
# build serial
for o in build_items:
Expand Down