Commit 86f98b0e authored by Stefan Behnel's avatar Stefan Behnel

handle failure to create a process pool in cythonize() by falling back to a single process

parent 360609df
......@@ -754,10 +754,11 @@ def cythonize(module_list, exclude=[], nthreads=0, aliases=None, quiet=False, fo
try:
import multiprocessing
pool = multiprocessing.Pool(nthreads)
pool.map(cythonize_one_helper, to_compile)
except ImportError:
except (ImportError, OSError):
print("multiprocessing required for parallel cythonization")
nthreads = 0
else:
pool.map(cythonize_one_helper, to_compile)
if not nthreads:
for args in to_compile:
cythonize_one(*args[1:])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment