99"""
1010
1111from __future__ import annotations
12- from typing import TYPE_CHECKING
12+ from typing import TYPE_CHECKING , override
1313import re
1414from os import path
1515import time
2323 from sphinx .application import Sphinx
2424 from sphinx .environment import BuildEnvironment
2525 from sphinx .config import Config as SphinxConfig
26- from collections .abc import Iterator
2726
2827from .config import Config
2928from .snippets import Snippet , WithTitle , Document , Section , Code
@@ -166,12 +165,14 @@ class SnippetBuilder(DummyBuilder): # DummyBuilder has dummy impls we need.
166165 'The snippet builder produces snippets (not to OUTPUTDIR) for use by snippet CLI tool'
167166 )
168167
169- def get_outdated_docs (self ) -> Iterator [str ]:
168+ @override
169+ def get_outdated_docs (self ) -> set [str ]:
170170 """Modified from :py:meth:`sphinx.builders.html.StandaloneHTMLBuilder.get_outdated_docs`."""
171+ outdated_docs = set ()
171172 for docname in self .env .found_docs :
172173 if docname not in self .env .all_docs :
173174 logger .debug ('[build target] did not in env: %r' , docname )
174- yield docname
175+ outdated_docs . add ( docname )
175176 continue
176177
177178 assert cache is not None
@@ -192,10 +193,11 @@ def get_outdated_docs(self) -> Iterator[str]:
192193 path .getmtime (self .env .doc2path (docname ))
193194 ),
194195 )
195- yield docname
196+ outdated_docs . add ( docname )
196197 except OSError :
197198 # source doesn't exist anymore
198199 pass
200+ return outdated_docs
199201
200202
201203def _format_modified_time (timestamp : float ) -> str :
0 commit comments