diff --git a/src/portable_python/__init__.py b/src/portable_python/__init__.py index d81a491..a797d76 100644 --- a/src/portable_python/__init__.py +++ b/src/portable_python/__init__.py @@ -605,10 +605,12 @@ def run_configure(self, program, *args, prefix=None): def run_make(self, *args, program="make", cpu_count=None): cmd = program.split() - if cpu_count and cpu_count < 0: + if cpu_count is None: available = multiprocessing.cpu_count() + # If we can't retrieve the number of cores, leave cpu_count as None + # and we'll omit -j below. if available and available > 0: - cpu_count += available + cpu_count = available if cpu_count and cpu_count > 1: cmd.append("-j%s" % cpu_count)