Skip to content

Commit 6ece3fb

Browse files
committed
Skip checking canonical links if nothing was built
1 parent 638d5e6 commit 6ece3fb

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

build_docs.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -1101,7 +1101,7 @@ def build_docs(args: argparse.Namespace) -> bool:
11011101
switchers_content = render_switchers(versions, languages)
11021102

11031103
build_succeeded = set()
1104-
build_failed = set()
1104+
any_build_failed = False
11051105
cpython_repo = Repository(
11061106
"https://github.com/python/cpython.git",
11071107
args.build_root / _checkout_name(args.select_output),
@@ -1130,7 +1130,7 @@ def build_docs(args: argparse.Namespace) -> bool:
11301130
if built_successfully:
11311131
build_succeeded.add((version.name, language.tag))
11321132
elif built_successfully is not None:
1133-
build_failed.add((version.name, language.tag))
1133+
any_build_failed = True
11341134

11351135
logging.root.handlers[0].setFormatter(
11361136
logging.Formatter("%(asctime)s %(levelname)s: %(message)s")
@@ -1153,11 +1153,13 @@ def build_docs(args: argparse.Namespace) -> bool:
11531153
args.skip_cache_invalidation,
11541154
http,
11551155
)
1156-
proofread_canonicals(args.www_root, args.skip_cache_invalidation, http)
1156+
if build_succeeded:
1157+
# Only check canonicals if at least one version was built.
1158+
proofread_canonicals(args.www_root, args.skip_cache_invalidation, http)
11571159

11581160
logging.info("Full build done (%s).", format_seconds(perf_counter() - start_time))
11591161

1160-
return len(build_failed) == 0
1162+
return any_build_failed
11611163

11621164

11631165
def parse_versions_from_devguide(http: urllib3.PoolManager) -> Versions:

0 commit comments

Comments
 (0)