summaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
authorThomas Waldmann <tw@waldmann-edv.de>2020-12-28 19:56:08 +0100
committerThomas Waldmann <tw@waldmann-edv.de>2020-12-28 19:56:08 +0100
commitd2fe3039672871c31b0bd60bdb7f0af1056b326c (patch)
tree4536354b5a42973ed4d55b526ec1af10de5dd74b /setup.py
parent5d46395ed0768c24621c77e621f4ccaccf43f509 (diff)
fix cythonize crash on macOS/py39, fixes #5599
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/setup.py b/setup.py
index 4152f9da2..9da06cb1b 100644
--- a/setup.py
+++ b/setup.py
@@ -63,7 +63,7 @@ prefer_system_libxxhash = not bool(os.environ.get('BORG_USE_BUNDLED_XXHASH'))
system_prefix_libxxhash = os.environ.get('BORG_LIBXXHASH_PREFIX')
# Number of threads to use for cythonize, not used on windows
-cpu_threads = multiprocessing.cpu_count() if multiprocessing else 1
+cpu_threads = multiprocessing.cpu_count() if multiprocessing and multiprocessing.get_start_method() != 'spawn' else None
# Are we building on ReadTheDocs?
on_rtd = os.environ.get('READTHEDOCS')
@@ -236,7 +236,7 @@ if not on_rtd:
)
if not is_win32:
# compile .pyx extensions to .c in parallel, does not work on windows
- cython_opts['nthreads'] = cpu_threads + 1
+ cython_opts['nthreads'] = cpu_threads
# generate C code from Cython for ALL supported platforms, so we have them in the sdist.
# the sdist does not require Cython at install time, so we need all as C.