summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorMatti Picus <matti.picus@gmail.com>2022-02-10 14:11:24 +0200
committerGitHub <noreply@github.com>2022-02-10 14:11:24 +0200
commit06ac5080f05cb489d9421949051870b5a0146e77 (patch)
treec65a99634065696fe939c7a7e508b1a5a3219220 /numpy
parentb97e7d585de4b80ae8202c1028c0dc03f5dde4ef (diff)
parent204f9318e5d32a3616913d0d4f16e6c63efb6ce8 (diff)
downloadnumpy-06ac5080f05cb489d9421949051870b5a0146e77.tar.gz
Merge pull request #21027 from GalaxySnail/fix-issue-21026
BUG: use `concurrent.futures.ThreadPoolExecutor` in distutils instead of `multiprocessing.pool.ThreadPool`
Diffstat (limited to 'numpy')
-rw-r--r--numpy/distutils/ccompiler.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/numpy/distutils/ccompiler.py b/numpy/distutils/ccompiler.py
index 16f00d8ed..74e2c51f6 100644
--- a/numpy/distutils/ccompiler.py
+++ b/numpy/distutils/ccompiler.py
@@ -355,10 +355,9 @@ def CCompiler_compile(self, sources, output_dir=None, macros=None,
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: