@@ -1101,7 +1101,7 @@ def build_docs(args: argparse.Namespace) -> bool:
11011101switchers_content = render_switchers (versions ,languages )
11021102
11031103build_succeeded = set ()
1104- build_failed = set ()
1104+ any_build_failed = False
11051105cpython_repo = Repository (
11061106"https://github.com/python/cpython.git" ,
11071107args .build_root / _checkout_name (args .select_output ),
@@ -1130,7 +1130,7 @@ def build_docs(args: argparse.Namespace) -> bool:
11301130if built_successfully :
11311131build_succeeded .add ((version .name ,language .tag ))
11321132elif built_successfully is not None :
1133- build_failed . add (( version . name , language . tag ))
1133+ any_build_failed = True
11341134
11351135logging .root .handlers [0 ].setFormatter (
11361136logging .Formatter ("%(asctime)s %(levelname)s: %(message)s" )
@@ -1153,11 +1153,13 @@ def build_docs(args: argparse.Namespace) -> bool:
11531153args .skip_cache_invalidation ,
11541154http ,
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
11581160logging .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
11631165def parse_versions_from_devguide (http :urllib3 .PoolManager )-> Versions :