Skip to content

Commit 79178e7

Browse files
authored
fix(setup_helpers): try import multiprocessing.synchronize too (#3043)
1 parent 19d99a8 commit 79178e7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pybind11/setup_helpers.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,9 @@ def _single_compile(obj):
410410
compiler._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
411411

412412
try:
413-
import multiprocessing
413+
# Importing .synchronize checks for platforms that have some multiprocessing
414+
# capabilities but lack semaphores, such as AWS Lambda and Android Termux.
415+
import multiprocessing.synchronize
414416
from multiprocessing.pool import ThreadPool
415417
except ImportError:
416418
threads = 1

0 commit comments

Comments
 (0)