Skip to content

Commit 261f218

Browse files
mdavidsaverralphlange
authored andcommitted
use cpu_count when available
1 parent a096fe1 commit 261f218

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

cue.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
import sysconfig
1616
import shutil
1717

18+
try:
19+
from os import cpu_count
20+
except ImportError:
21+
def cpu_count():
22+
pass # undetermined
23+
1824
logger = logging.getLogger(__name__)
1925

2026
# Keep track of all files we write/append for later logging
@@ -151,7 +157,7 @@ def detect_context():
151157
if 'TEST' in os.environ and os.environ['TEST'].lower() == 'no':
152158
ci['test'] = False
153159

154-
ci['parallel_make'] = 2
160+
ci['parallel_make'] = cpu_count() or 2
155161
if 'PARALLEL_MAKE' in os.environ:
156162
ci['parallel_make'] = int(os.environ['PARALLEL_MAKE'])
157163

0 commit comments

Comments
 (0)