fix(setup_helpers): try import multiprocessing.synchronize too (#3043)

This commit is contained in:
jbarlow83 2021-06-18 07:17:34 -07:00 committed by GitHub
parent 19d99a87fe
commit 79178e713d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -410,7 +410,9 @@ class ParallelCompile(object):
compiler._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
try:
import multiprocessing
# Importing .synchronize checks for platforms that have some multiprocessing
# capabilities but lack semaphores, such as AWS Lambda and Android Termux.
import multiprocessing.synchronize
from multiprocessing.pool import ThreadPool
except ImportError:
threads = 1