Fix `SIM904`, directly construct dicts (#11059)

This commit is contained in:
danieleades 2023-01-01 17:54:11 +00:00 committed by GitHub
parent ff202240ab
commit 124bbce049
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 6 deletions

View File

@ -21,7 +21,6 @@ ignore =
SIM223,
SIM300,
SIM401,
SIM904,
SIM905,
SIM907,
exclude =

View File

@ -148,11 +148,11 @@ class Epub3Builder(_epub_base.EpubBuilder):
"""Create a dictionary with all metadata for the nav.xhtml file
properly escaped.
"""
metadata = {}
metadata['lang'] = html.escape(self.config.epub_language)
metadata['toc_locale'] = html.escape(self.guide_titles['toc'])
metadata['navlist'] = navlist
return metadata
return {
'lang': html.escape(self.config.epub_language),
'toc_locale': html.escape(self.guide_titles['toc']),
'navlist': navlist
}
def build_navigation_doc(self) -> None:
"""Write the metainfo file nav.xhtml."""