From 2910a92d66c839e9bbb13a12bc6d9222da00cbcc Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+aa-turner@users.noreply.github.com> Date: Fri, 29 Dec 2023 17:11:30 +0000 Subject: [PATCH] Prefer dict.fromkeys --- sphinx/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sphinx/config.py b/sphinx/config.py index f5b54155e..5a996fa89 100644 --- a/sphinx/config.py +++ b/sphinx/config.py @@ -406,7 +406,7 @@ def convert_source_suffix(app: Sphinx, config: Config) -> None: config.source_suffix = {source_suffix: None} # type: ignore[attr-defined] elif isinstance(source_suffix, (list, tuple)): # if list, considers as all of them are default filetype - config.source_suffix = {s: None for s in source_suffix} # type: ignore[attr-defined] + config.source_suffix = dict.fromkeys(source_suffix, None) # type: ignore[attr-defined] elif not isinstance(source_suffix, dict): logger.warning(__("The config value `source_suffix' expects " "a string, list of strings, or dictionary. "