From e5afc5297af12b14a91ae72b16efec3b151ed702 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 22 Apr 2019 08:49:22 +0530 Subject: [PATCH] Dont use multiprocessing to get CPU counts --- setup.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index e6c42d069..9f9716124 100755 --- a/setup.py +++ b/setup.py @@ -337,8 +337,7 @@ def dependecies_for(src, obj, all_headers): def parallel_run(todo, desc='Compiling {} ...'): try: - from multiprocessing import cpu_count - num_workers = max(1, cpu_count()) + num_workers = max(2, os.cpu_count()) except Exception: num_workers = 2 items = list(reversed(tuple(todo.items()))) @@ -614,8 +613,7 @@ def compile_python(base_path): import compileall import py_compile try: - from multiprocessing import cpu_count - num_workers = max(1, cpu_count()) + num_workers = max(1, os.cpu_count()) except Exception: num_workers = 1 for root, dirs, files in os.walk(base_path):