From 480f4bf44ed52a2a856a8e6f372a06e58c4dc9c4 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 19 Nov 2017 11:49:42 +0530 Subject: [PATCH] Build script should not fail on python without threading --- setup.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index d5874d473..e4c8d628f 100755 --- a/setup.py +++ b/setup.py @@ -11,7 +11,6 @@ import shutil import subprocess import sys import sysconfig -from multiprocessing import cpu_count base = os.path.dirname(os.path.abspath(__file__)) build_dir = os.path.join(base, 'build') @@ -270,7 +269,11 @@ def emphasis(text): def parallel_run(todo, desc='Compiling {} ...'): - num_workers = max(1, cpu_count()) + try: + from multiprocessing import cpu_count + num_workers = max(1, cpu_count()) + except Exception: + num_workers = 2 items = list(todo.items()) workers = {} failed = None