Skip to content

Commit

Permalink
Remove dead class attributes (sphinx-doc#12545)
Browse files Browse the repository at this point in the history
  • Loading branch information
AA-Turner authored Jul 11, 2024
1 parent 6b37a6b commit e7beb8b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
13 changes: 6 additions & 7 deletions sphinx/builders/html/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,13 +484,12 @@ def prepare_writing(self, docnames: set[str]) -> None:

# format the "last updated on" string, only once is enough since it
# typically doesn't include the time of day
self.last_updated: str | None
lufmt = self.config.html_last_updated_fmt
if lufmt is not None:
self.last_updated = format_date(lufmt or _('%b %d, %Y'),
language=self.config.language)
last_updated: str | None
if (lu_fmt := self.config.html_last_updated_fmt) is not None:
lu_fmt = lu_fmt or _('%b %d, %Y')
last_updated = format_date(lu_fmt, language=self.config.language)
else:
self.last_updated = None
last_updated = None

# If the logo or favicon are urls, keep them as-is, otherwise
# strip the relative path as the files will be copied into _static.
Expand Down Expand Up @@ -529,7 +528,7 @@ def prepare_writing(self, docnames: set[str]) -> None:
'project': self.config.project,
'release': return_codes_re.sub('', self.config.release),
'version': self.config.version,
'last_updated': self.last_updated,
'last_updated': last_updated,
'copyright': self.config.copyright,
'master_doc': self.config.root_doc,
'root_doc': self.config.root_doc,
Expand Down
1 change: 0 additions & 1 deletion sphinx/writers/html5.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ def __init__(self, document: nodes.document, builder: Builder) -> None:

self.highlighter = self.builder.highlighter
self.docnames = [self.builder.current_docname] # for singlehtml builder
self.manpages_url = self.config.manpages_url
self.protect_literal_text = 0
self.secnumber_suffix = self.config.html_secnumber_suffix
self.param_separator = ''
Expand Down

0 comments on commit e7beb8b

Please sign in to comment.