summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Berg <sebastian@sipsolutions.net>2022-05-05 00:16:58 +0200
committerSebastian Berg <sebastian@sipsolutions.net>2022-05-05 00:16:58 +0200
commit806d126d5f0c657ea53cf7acc6941b77960dd0a3 (patch)
tree096a43bf7245b31e388ec378a307106013cc80c9
parent5c740d0ca3d35c151c5120a551a69319ffac04d9 (diff)
downloadnumpy-806d126d5f0c657ea53cf7acc6941b77960dd0a3.tar.gz
BUG: Ensure compile errors are raised correclty
This has been bugging me for a bit. The concurrent.futures Executor requires checking the result for the error to be raised. That makes sense, but just means we need to consume the result explicitly here to ensure we know about compile errors. Otherwise, compile errors just pass silently (which is very confusing if the old object files are still around and the tests run based on the old version).
-rw-r--r--numpy/distutils/ccompiler.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/numpy/distutils/ccompiler.py b/numpy/distutils/ccompiler.py
index df268d1de..8697fae62 100644
--- a/numpy/distutils/ccompiler.py
+++ b/numpy/distutils/ccompiler.py
@@ -357,7 +357,8 @@ def CCompiler_compile(self, sources, output_dir=None, macros=None,
# build parallel
from concurrent.futures import ThreadPoolExecutor
with ThreadPoolExecutor(jobs) as pool:
- pool.map(single_compile, build_items)
+ res = pool.map(single_compile, build_items)
+ list(res) # access result to raise errors
else:
# build serial
for o in build_items: