diff --git a/snapcraft/utils.py b/snapcraft/utils.py index 1a362d9072b..7f32c4ba4bd 100644 --- a/snapcraft/utils.py +++ b/snapcraft/utils.py @@ -234,11 +234,12 @@ def get_parallel_build_count() -> int: build_count = 1 try: - max_count = int(os.environ.get("SNAPCRAFT_MAX_PARALLEL_BUILD_COUNT", "")) + max_count_env = os.environ.get("SNAPCRAFT_MAX_PARALLEL_BUILD_COUNT", "") + max_count = int(max_count_env) if max_count > 0: build_count = min(build_count, max_count) except ValueError: - emit.debug("Invalid SNAPCRAFT_MAX_PARALLEL_BUILD_COUNT value") + emit.debug(f"Invalid SNAPCRAFT_MAX_PARALLEL_BUILD_COUNT {max_count_env!r}") return build_count