Skip to content

Commit e7beb8b

Browse files
authored
Remove dead class attributes (#12545)
1 parent 6b37a6b commit e7beb8b

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

sphinx/builders/html/__init__.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -484,13 +484,12 @@ def prepare_writing(self, docnames: set[str]) -> None:
484484

485485
# format the "last updated on" string, only once is enough since it
486486
# typically doesn't include the time of day
487-
self.last_updated: str | None
488-
lufmt = self.config.html_last_updated_fmt
489-
if lufmt is not None:
490-
self.last_updated = format_date(lufmt or _('%b %d, %Y'),
491-
language=self.config.language)
487+
last_updated: str | None
488+
if (lu_fmt := self.config.html_last_updated_fmt) is not None:
489+
lu_fmt = lu_fmt or _('%b %d, %Y')
490+
last_updated = format_date(lu_fmt, language=self.config.language)
492491
else:
493-
self.last_updated = None
492+
last_updated = None
494493

495494
# If the logo or favicon are urls, keep them as-is, otherwise
496495
# strip the relative path as the files will be copied into _static.
@@ -529,7 +528,7 @@ def prepare_writing(self, docnames: set[str]) -> None:
529528
'project': self.config.project,
530529
'release': return_codes_re.sub('', self.config.release),
531530
'version': self.config.version,
532-
'last_updated': self.last_updated,
531+
'last_updated': last_updated,
533532
'copyright': self.config.copyright,
534533
'master_doc': self.config.root_doc,
535534
'root_doc': self.config.root_doc,

sphinx/writers/html5.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ def __init__(self, document: nodes.document, builder: Builder) -> None:
5959

6060
self.highlighter = self.builder.highlighter
6161
self.docnames = [self.builder.current_docname] # for singlehtml builder
62-
self.manpages_url = self.config.manpages_url
6362
self.protect_literal_text = 0
6463
self.secnumber_suffix = self.config.html_secnumber_suffix
6564
self.param_separator = ''

0 commit comments

Comments
 (0)