diff --git a/setup.py b/setup.py index cf99ec3aaaf..8859d0a9367 100644 --- a/setup.py +++ b/setup.py @@ -216,7 +216,7 @@ class cmake_build_ext(build_ext): # `num_jobs` is either the value of the MAX_JOBS environment variable # (if defined) or the number of CPUs available. num_jobs = envs.MAX_JOBS - if num_jobs is not None: + if isinstance(num_jobs, str) and num_jobs.isnumeric(): num_jobs = int(num_jobs) logger.info("Using MAX_JOBS=%d as the number of jobs.", num_jobs) else: