From 5841ba9a082d40127019c1fd9983a5f30cc628e8 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Mon, 17 Nov 2025 11:04:12 -0800 Subject: [PATCH] use cpu_count when available --- cue.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cue.py b/cue.py index 403e32f..0036abb 100644 --- a/cue.py +++ b/cue.py @@ -15,6 +15,12 @@ import sysconfig import shutil +try: + from os import cpu_count +except ImportError: + def cpu_count(): + pass # undetermined + logger = logging.getLogger(__name__) # Keep track of all files we write/append for later logging @@ -151,7 +157,7 @@ def detect_context(): if 'TEST' in os.environ and os.environ['TEST'].lower() == 'no': ci['test'] = False - ci['parallel_make'] = 2 + ci['parallel_make'] = cpu_count() or 2 if 'PARALLEL_MAKE' in os.environ: ci['parallel_make'] = int(os.environ['PARALLEL_MAKE'])