Skip to content

Commit

Permalink
Ensure sphinx doc attributes are available before trying to access th…
Browse files Browse the repository at this point in the history
…em (patroni#3156)

Very old versions of sphinx (e.g. as shipped in Ubuntu 20.04 LTS) might not have them.

Close patroni#3155
  • Loading branch information
mbanck-ntap authored Sep 12, 2024
1 parent b3ae865 commit 4c951a2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,13 +289,15 @@ def env_get_outdated(app, env, added, changed, removed):
Remove the items listed in `docs_to_remove` from known pages.
"""
to_remove = set()
for doc in env.found_docs:
if _to_be_removed(doc):
to_remove.add(doc)
if hasattr(env, 'found_docs'):
for doc in env.found_docs:
if _to_be_removed(doc):
to_remove.add(doc)
added.difference_update(to_remove)
changed.difference_update(to_remove)
removed.update(to_remove)
env.project.docnames.difference_update(to_remove)
if hasattr(env, 'project'):
env.project.docnames.difference_update(to_remove)
return []


Expand Down

0 comments on commit 4c951a2

Please sign in to comment.