From 1121e5e8bc60fc9a25959f28b2c8a5890acb2d88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Freitag?= Date: Sun, 24 Jan 2021 12:24:52 +0100 Subject: [PATCH] Linkcheck: Derive number of links from the post-transform result The number of links to check is the number of links in self.hyperlinks, populated by the post-transform. --- sphinx/builders/linkcheck.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sphinx/builders/linkcheck.py b/sphinx/builders/linkcheck.py index f813922ec..f48a41802 100644 --- a/sphinx/builders/linkcheck.py +++ b/sphinx/builders/linkcheck.py @@ -445,14 +445,13 @@ class CheckExternalLinksBuilder(DummyBuilder): def finish(self) -> None: logger.info('') - n = 0 for hyperlink in self.hyperlinks.values(): self.wqueue.put(hyperlink, False) - n += 1 + total_links = len(self.hyperlinks) done = 0 - while done < n: + while done < total_links: self.process_result(self.rqueue.get()) done += 1