From: Stefan Behnel Date: Sat, 10 Aug 2013 13:20:56 +0000 (+0200) Subject: handle failure to create a process pool in cythonize() by falling back to a single... X-Git-Tag: 0.20b1~392 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=86f98b0eb74a7945f7557537763fe19c4cc1a7a4;p=platform%2Fupstream%2Fpython-cython.git handle failure to create a process pool in cythonize() by falling back to a single process --- diff --git a/Cython/Build/Dependencies.py b/Cython/Build/Dependencies.py index a06fe40..d718504 100644 --- a/Cython/Build/Dependencies.py +++ b/Cython/Build/Dependencies.py @@ -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:])