Skip to content

Commit

Permalink
Merge pull request #21141 from charris/backport-21027
Browse files Browse the repository at this point in the history
BUG: use ThreadPoolExecutor instead of ThreadPool
  • Loading branch information
charris committed Mar 3, 2022
2 parents 954c9b5 + a794a6f commit cfff158
Showing 1 changed file with 3 additions and 4 deletions.
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

0 comments on commit cfff158

Please sign in to comment.