From cd57c8b9ee495bd248da0b81541d335c1b97b20f Mon Sep 17 00:00:00 2001 From: Sebastian Berg Date: Thu, 5 May 2022 00:16:58 +0200 Subject: [PATCH] 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). --- numpy/distutils/ccompiler.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/numpy/distutils/ccompiler.py b/numpy/distutils/ccompiler.py index 74e2c51f600c..0bc34326c59f 100644 --- a/numpy/distutils/ccompiler.py +++ b/numpy/distutils/ccompiler.py @@ -357,7 +357,8 @@ def single_compile(args): # 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: